3300.me

lamp

last update: 2020/04/01

Control Panel: Domain management service

# Set NameServer

Control Panel: Server setting

# Add DNS Record (Type: A, Name: @, TTL: 3600, Value: {IP address})

Apache

yum install httpd
systemctl start httpd
systemctl enable httpd
vi {DocumentRoot}/index.html

MariaDB

yum -y install mariadb-server
systemctl enable mariadb
systemctl start mariadb
mysql_secure_installation

PHP

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum install --enablerepo=remi,remi-php72 php php-devel php-mbstring php-mysqlnd php-pdo php-gd

Let's Encrypt (SSL)

vi /etc/httpd/conf/httpd.conf
# Add the following code below "Listen 80"
<VirtualHost *:80>
ServerAdmin root@{example.com}
DocumentRoot {DocumentRoot}
ServerName {example.com}
</VirtualHost>

yum install mod_ssl
yum install certbot python2-certbot-apache
certbot --apache -d {example.com}

vi /etc/crontab
# Add the following code bottom
0 0 * * * root /usr/bin/certbot renew

Setting firewall

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
sudo firewall-cmd --reload

Restart

systemctl restart httpd