Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress Reply To: Error connecting remote DB

Discussion in 'Misc WordPress Requests' started by Cesare Rossi, Dec 4, 2017.

  1. Cesare Rossi

    Guest

    Reply To: Error connecting remote DB, by Cesare Rossi

    This is the wp.sh install script (CentOS 6):

    #!/bin/bash

    WP_DB_NAME=wordpress
    WP_DB_USER=wordpressuser
    WP_DB_PASSWORD=VMware1!
    WP_DB_HOST=centosdb.ross.lan
    site_ip=centos6.ross.lan
    wordpress_site_files=/var/www/html/
    site_title=Wordpress01
    admin_user=admin
    admin_password=VMware1!
    [email protected]

    /sbin/chkconfig iptables off
    /sbin/chkconfig ip6tables off
    /sbin/service iptables stop
    /sbin/service ip6tables stop

    yum install -y wget
    yum install -y mysql

    /usr/bin/yum install httpd -y
    /sbin/chkconfig httpd on
    /sbin/service httpd start

    /usr/bin/yum install php php-mysql mysql-client -y
    /usr/bin/yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

    /sbin/service httpd restart

    curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
    chmod +x wp-cli.phar
    mv wp-cli.phar /usr/local/bin/wp

    touch /var/www/html/index.php
    echo “<html><body><h1>Welcome to VMware Apache Server! My IP Address is: <?php echo \$_SERVER[‘SERVER_ADDR’]; ?></h1></body></html>” > /var/www/html/index.php

    cd /tmp
    /usr/bin/wget http://wordpress.org/latest.tar.gz –output-document=/tmp/latest.tar.gz
    /bin/tar -xzvf /tmp/latest.tar.gz
    yes | cp -rf /tmp/wordpress/* /var/www/html/

    cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
    /bin/sed -i “s/database_name_here/$WP_DB_NAME/g” /var/www/html/wp-config.php
    /bin/sed -i “s/username_here/$WP_DB_USER/g” /var/www/html/wp-config.php
    /bin/sed -i “s/password_here/$WP_DB_PASSWORD/g” /var/www/html/wp-config.php
    /bin/sed -i “s/localhost/$WP_DB_HOST/g” /var/www/html/wp-config.php

    wp core install –url=http://$site_ip –path=$wordpress_site_files –title=”Welcome to the home of the $site_title” –admin_user=$admin_user –admin_password=$admin_password –admin_email=$admin_email

    /sbin/service httpd restart

    Reply To: Error connecting remote DB
     
    #1

Share This Page

Web Hosting