Last update at :2024-01-07,Edit by888u
VpsAdd tutorial: CentOS 7< /a>Install LAMP
Linux+Apache+Mysql/MariaDB+Perl/PHP/Python is a group of open source software commonly used to build dynamic websites or servers. They are independent programs, but because they are often used together, they have more and more The higher the compatibility, the more powerful the web application platform is. With the vigorous development of the open source trend, open source LAMP has formed a three-legged trend with J2EE and .Net commercial software, and the software development project has a low investment cost in software, so it has attracted the attention of the entire IT community. In terms of website traffic, more than 70% of the access traffic is provided by LAMP. LAMP is the most powerful website solution.
1. Clear and upgrade the system yum clean all yum -y update hostname localhost systemctl stop firewalld systemctl disable firewalld
2. Install CSF cd /usr/src rm -fvcsf.tgz wget https://download.configserver.com/csf.tgz tar -xzf csf.tgz cdcsf sh install.sh
3. Configure CSF nano /etc/csf/csf.conf
Input csf -r
Save and exit.
4. Change the OpenSSH default port (or leave it unchanged) cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak nano /etc/ssh/sshd_config Find Port 22, change to other port, and let it pass in CSF.
Save and launch. Restart the service: systemctl restart sshd.service
5. Install Apache
a. Clear old services: yum -y install httpd
b. Set up the domain name directory (change example.com to your own domain name) mkdir -p /var/www/example.com/public_html chown -R $USER:$USER /var/www/example.com/public_html chmod -R 755 /var/www mkdir /etc/httpd/sites-available mkdir /etc/httpd/sites-enabled
c. Edit configuration file nano /etc/httpd/conf/httpd.conf Put IncludeOptional sites-enabled/*.conf at the bottom of the file
d. Save and exit. nano /etc/httpd/sites-available/example.com.conf
e. Add the following to the website configuration file (change example.com to your own domain name)
f. Save and exit. ln -s /etc/httpd/sites-available/example.com.conf /etc/httpd/sites-enabled/example.com.conf apachectl restart
6. Install CertBot (use lets-encrypt to create ssl certificate) yum install epel-release yum install certbot certbot certonly
The following are the installation commands: certbot renew –dry-run certbot renew –quiet
7. Install PHP 5.6 yum -y update yum -y install epel-release wget https://dl.fedoraproject.org/pub/epe…t-7.noarch.rpm wget https://centos7.iuscommunity.org/ius-release.rpm rpm -Uvh ius-release*.rpm yum -y update yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath
8. Install MySQL yum -y install mariadb-server mariadb systemctl start mariadb mysql_secure_installation
9. Install phpMyAdmin yum -y install phpmyadmin nano /etc/httpd/conf.d/phpMyAdmin.conf Change 127.0.0.1 to your independent IP Alias /phpMyAdmin /usr/share/phpMyAdmin (change /phpMyAdmin to /usr/share/phpMyAdmin)
10. Restart the service systemctl restart httpd.service
via: http://www.webhostingtalk.com/showthread.php?t=1588551
Recommended site search: National mixed server, cheap domain name, foreign server, Alibaba Cloud server, domain name registration information inquiry, Hong Kong server recommendation, vps server rental, domain name registration center, US attack defense server, apply for free space and domain name,
发表评论