Step 1: Log into the Dev Server using SSH

ssh -i factorydev.pem

— Step 2: Create the database

  • Use this command and replace “example” with the name of the database you would like to create:
    mysqladmin -uroot -p create example
  • The password for the dev database is:

— Step 3: Install WordPress for the New Site

  • To install WordPress, type:
    cd /var/www/dev
    tar -xzvf latest.tar.gz
  • WordPress is now in its own “wordpress” directory. We will move the contents to the root folder:
    mv wordpress
  • Create the WordPress wp-config.php file:
    mv wp-config-sample.php wp-config.php
    vi wp-config.php
  1. Type i to start insert mode.
  2. Modify the database connection parameters as follows:
    define(‘DB_NAME’, ‘example’);
    define(‘DB_USER’, ‘root’);
    define(‘DB_PASSWORD’, ‘C6X0u2$1Nx79’);
    define(‘DB_HOST’, ‘localhost’);
  3. Add the WordPress config keys by generating them here:
  4. Add the following right below define(‘WP_DEBUG’, false);:
    define( 'WP_MEMORY_LIMIT', '96M' );
    define( 'DBI_AWS_SECRET_ACCESS_KEY', 'oJqvPk6OYio8xlh15wg8/aB6EES4w37T+bhh86xZ' );
  5. Press ESC then type :wq to write the file and quit vi
  • Fix Apache permissions
    chown -R apache:vpsusers /var/www/dev/
    chmod -R g+ws /var/www/dev/

— Step 4: Setup the vhost Config for the Sub-Domain

  • Edit the vhost.conf file
     vi /etc/httpd/conf.d/vhost.conf
  • Copy the code below and change out all of the for the folder you created in step 2.
    # Example
    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/dev/
        <Directory /var/www/dev/>
         Options Indexes FollowSymLinks MultiViews
         AllowOverride All
         Order allow,deny
         allow from all
    <VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/localhost.crt
        SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
        <Directory /var/www/dev/>
            AllowOverride All
        DocumentRoot /var/www/dev/
  • Restart the web server
    service httpd restart

Start typing and press Enter to search