Let's Just Blog-103
LAMP Stack?
Following Let's Just Blog-102 and a link on Digital Ocean, I will install LAMP and Wordpress on f1-micro instance of GCP, and you should able to blog hopefully without much of a initial capital expense. Please enable Google Cloud with your email, and provision an free f1-micro VM. Joe from One Page Zen has published a blog that uses the Wordpress pre-build image from marketplace. I will try sticking with Wordpress on LAMP stack.
Install LAMP
You should also allow the http traffic and easiest way to enable the "Allow Http Traffic" checkbox.
Install LAMP
ssh-keygen -t rsa -f ./yourkey -C ubuntu
ssh -i yourkey ubuntu@youripaddress
After generating the ssh key and associating it with your instance, please connect to your vm with ssh. You should also allow the http traffic and easiest way to enable the "Allow Http Traffic" checkbox.
sudo apt update
sudo apt install apache2
sudo ufw app list
http://youripaddress/
sudo apt install mysql-server
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH
mysql_native_password BY 'password';
exit
sudo apt install php libapache2-mod-php php-mysql
sudo vi /etc/apache2/mods-enabled/dir.conf
Add index.php as the first index for DirectoryIndex property
DirectoryIndex index.php index.html
index.cgi index.pl index.xhtml index.htm
sudo systemctl restart apache2
sudo systemctl status apache2
sudo vi /var/www/html/info.php
http://your_server_ip/info.php
sudo rm /var/www/html/info.php
Congratulations on installing the LAMP stack!
Wordpress on LAMP Stack?
Install Wordpress
mysql -u root -p
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci;
GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost'
IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;
sudo apt update
sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc
php-soap php-intl php-zip
sudo systemctl restart apache2
sudo cp /etc/apache2/sites-available/000-default.conf
/etc/apache2/sites-available/wordpress.conf
sudo vi /etc/apache2/sites-available/wordpress.conf
Update the Allow Override property
sudo a2enmod rewrite
sudo apache2ctl configtest
cd /tmp
curl -O https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
touch /tmp/wordpress/.htaccess
cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
mkdir /tmp/wordpress/wp-content/upgrade
sudo cp -a /tmp/wordpress/. /var/www/wordpress
sudo chown -R www-data:www-data /var/www/wordpress
sudo find /var/www/wordpress/ -type d -exec chmod 750 {} \;
sudo find /var/www/wordpress/ -type f -exec chmod 640 {} \;
curl -s https://api.wordpress.org/secret-key/1.1/salt/
sudo vi /var/www/wordpress/wp-config.php
Update the Security Keys and Database values.
Enable the wordpress configuration and disable the 000-default configuration
sudo a2ensite wordpress
sudo a2dissite 000-default
http://yourIP
Go through simple web install of wordpress.
Comments
Post a Comment