sudo apt-get update
//1.LAMP
sudo apt-get install apache2
sudo apt-get install PHP
PHP -v
sudo apt-get install libapache2-mod-PHP //PHP libs for apache2
sudo apt-get install MysqL-serverMysqL-secure-installation //install MysqL server
MysqL -hlocalhost -uroot -ppwd //check
sudo apt-get install PHP7.0-MysqL //PHP support MysqL
sudo service MysqL restart
sudo service apache2 restart
sudo apt-get install PHP-mcrypt PHP-MysqL PHP-gd PHP-imap PHP-ldap PHP-mbstring PHP-odbc PHP-pear PHP-xml PHP-xmlrpc PHP-gettext //PHP modules
sudo chmod 777 /var/www/html // aparche2 html root dir permissions
sudo apt-get install PHPmyadin //gui MysqL manager and need PHP-mbstring PHP and PHP-gettext
sudo gedit /etc/apache2/apache2.conf //add 'ServerName server_domain_or_ip'in apache2.conf
sudo gedit /etc/apache2/mods-enabled/dir.conf //modify default page from index.html to index.PHP
sudo systemctl restart apache2
sudo systemctl status apache2 //check on the status of apache2 service
sudo apache2ctl configtest //Syntax ok verity server name
sudo ufw app list //firwall app list
sudo ufw app info "Apache2 Full" //watch ports 80,443/tcp
sudo ufw allow in "Apache2 Full" //allow apache2 in firwall
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。