Documents on digitalocean are well-written.
Install LAMP
apache(httpd)
The package name of apache under CentOS is httpd, not ‘apache’ itself.
- Install
- Start
- Set on boot
mysql(mariadb)
- Install and start
- Security setting script (don’t forget to set the root password)
- Set on boot
php
- Install
- Restart apache
Then we shall test while php is running correctly. Create an info.php under default web directory /var/www/html/
.
Use the browser to open http://[your ip or domain]/info.php, check the page. Delete info.php after everything is correct.
After installing wordpress you may found it said php’s version too low. But there is no higher version of php in repo, so we need to reinstall php7.
- Enable remi repo
- Install php7.3 and useful modules
Check php version
Then restart apache.
Install wordpress
Create database
Enter mysql console
Enter the follow commands in console (change the database name, username and password)
Install wordpress
- Get the latest wordpress:
- Copy files to
www
directory:
- Create a directory for uploading:
- Change file owner:
Configure wordpress
Edit these lines in wp-config.php
(three lines):
Use acme.sh to get cert
Install acme.sh
You may link acme.sh to /usr/local/bin
Generate cert
Make sure your domain is correctly resolved. Suppose we use cloudflare as nameserver. Login to cloudflare and get your own API key.
Export two variabels:
Get the cert:
Install cert
Use the command recommanded by acme:
Configure apache
Open the browser and following wordpress’s installing steps.
REF
- https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-centos-7#step-2-%E2%80%94-checking-your-web-server
- https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-centos-7#prerequisites
- https://linuxize.com/post/install-php-7-on-centos-7/#configuring-php-7x-to-work-with-apache
- https://github.com/acmesh-official/acme.sh/wiki/%E8%AF%B4%E6%98%8E