Skip to content

Instantly share code, notes, and snippets.

@trungpv1601
Created October 11, 2019 02:37
Show Gist options
  • Save trungpv1601/68bd15b1e74d28a64d55d71e9f11895a to your computer and use it in GitHub Desktop.
Save trungpv1601/68bd15b1e74d28a64d55d71e9f11895a to your computer and use it in GitHub Desktop.
Setup new Wordpress site on ubuntu
  1. Setup Apache

sudo mkdir -p /var/www/xxx.com

sudo chown -R www-data: /var/www/xxx.com

/etc/apache2/sites-available/xxx.com.conf

<VirtualHost *:80>
    ServerName xxx.com
    ServerAlias www.xxx.com
    ServerAdmin [email protected]
    DocumentRoot /var/www/xxx.com

    <Directory /var/www/xxx.com>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/xxx.com-error.log
    CustomLog ${APACHE_LOG_DIR}/xxx.com-access.log combined
</VirtualHost>

sudo a2ensite xxx.com

sudo service apache2 restart

  1. Setup wordpress

cd /var/www/xxx.com

wget https://wordpress.org/latest.zip

unzip latest.zip

cd wordpress/

sudo mv * ../

sudo rm -R wordpress/

  1. Create MYSQL

mysql -u root -p

MYSQL Command

CREATE DATABASE xxxDB;
CREATE USER 'xxxUser'@'%' IDENTIFIED BY '_password_';
GRANT ALL PRIVILEGES ON xxxDB.* TO 'xxxUser'@'%';
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment