Want to subscribe to topics you're interested in?
Become a Member

Sysadmin test server

Discussion in 'System Administration' started by dooma, Jul 8, 2017.

  1. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  2. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    ah it's due to backslashes having different meaning on SSH command line to mean a command
    Code (Text):
    `dbname`
    

    change and remove backslashes
    Code (Text):
    `dbname`.*
    

    to
    Code (Text):
    dbname.*
    

    so
    Code (Text):
    mysql -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON dbname.* TO 'dbuser'@'localhost';"
     
    Last edited: Jul 8, 2017
  3. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    Thanks a lot but still this issue :

    Code (Text):
    [[email protected] home]# mysql -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON 'xfdbdooma.*' TO 'doomauserf'@'localhost';"
    ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''xfdbdooma.*' TO 'doomauserf'@'localhost'' at line 1
    
     
  4. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    I solved it :D
     
    • Like Like x 1
  5. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    It should be
    xfdbdooma.*

    and the ' ' should be deleted ..

    Happy to find a solution for the first time :D
     
    • Agree Agree x 1
  6. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  7. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    Thanks a lot for your efforts. really thanks :) but can you please delete the info of database name and username from the previous replies. and I will modify mine.
     
    • Agree Agree x 1
  8. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    • Like Like x 1
  9. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    Now, should I transferred all the files of my forums and my database at the main server to the remote one ??
     
  10. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    The plublic file of the remote one has a dmedomain.com and its content is the main when u setup centminmod server ?? and the main server is down?
     
  11. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    • Like Like x 1
  12. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    Why the main website when I use https:// gives me down and when I go to it without http or https it gives me the centminmod installed page. ?
     
  13. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    main host.domain.com for server is always only non-HTTPS based

    or you mean your domain.com site ?

    please clarify which server you visiting live or remote/new server's copy ?
     
  14. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    The remote server demodomain.com takes me to centminmod index page and when I checked its public file. I didn't find the files of xenforo that should have been copied from the main server.

    The main server website is not working and it gives me down when I go to https://domain.com but it gives me the centminmod index page when I go to domain.com .
     
  15. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    main host.domain.com for server is always only non-HTTPS based as outlined in getting started step 1

    summary for getting started guide
    that's normal as no valid DNS for demo domain will always direct to main host.domain.com vhost

    have you setup domain's local hosts file edit to preview domain yet Centmin Mod Site Data Migration Guide ?
     
  16. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    if you have done local hosts edit preview to bypass DNS, and properly copied via rsync all site data to remote/new server, make sure you restarted nginx and php-fpm on remote/new server for the new vhosts to take effect

    ensure all the nginx site config files outlined at https://centminmod.com/configfiles.html match on both live and new/remote servers

    i.e. nginx vhost files at /usr/local/nginx/conf/conf.d
    Code (Text):
    ls -lah /usr/local/nginx/conf/conf.d
    

    nginx ssl files at /usr/local/nginx/conf/ssl/
    Code (Text):
    ls -lah /usr/local/nginx/conf/ssl/
    
     
  17. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    really am confused and everything is down.

    Thanks alot anyway :)

    The Main server is down ! and Iam not able to define the reason ??

    thats my host file :

    Code:
    # Copyright (c) 1993-2009 Microsoft Corp.
    
           My.SERVER.IP.XX   mymaindomain.com
    
    
    is that correct ?
     
    Last edited: Jul 8, 2017
  18. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    that is correct so you are visit mymaindomain.com on new server and that is down on new server if you comment out the line with hash in front and clear browser cache, should go back to visiting live server version

    check remote/new server nginx vhost configs are matching live servers Sysadmin - test server

    if you set a specific IP address to listen to in nginx vhost domain.com.conf and domain.com.ssl.conf on live server instead of just listen 80; directive, then on new server need to change that listen ip to the new remote server's ip.
     
  19. eva2000

    eva2000 Administrator Staff Member

    42,759
    9,677
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,932
    Local Time:
    7:00 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    on your live server, you can check the remote/new server's listing for nginx vhosts and ssl directory via commands
    Code (Text):
    remoteip=111.222.333.444
    port=22
    privatekey=my1.key
    

    privatekey was created via keygen.sh so leave it as my1.key value and change remoteip variable to your remote server's ip
    then to check type

    check nginx vhosts on remote server, you are ssh in with private key and listing via ls command remote directory
    Code (Text):
    ssh -p $port -i $HOME/.ssh/$privatekey [email protected]$remoteip ls -lah /usr/local/nginx/conf/conf.d
    

    for nginx ssl directories
    Code (Text):
    ssh -p $port -i $HOME/.ssh/$privatekey [email protected]$remoteip ls -lah /usr/local/nginx/conf/ssl
    
     
  20. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    11:00 PM
    The main server has Both :
    -rw-r--r-- 1 root root 1.1K Jul 2 23:19 demodomain.com.conf
    -rw-r--r-- 1 root root 2.2K Jul 4 06:05 maindomain.com.conf

    but the remote server has this one only :
    -rw-r--r-- 1 root root 1.1K Jul 2 23:19 demodomain.com.conf

    I thought that when I uncomment the IP at hosts file,and go to remote server IP, it will take me to the xenforo forums too to make some tests ?!!