Ubuntu配置Apache2+PHP+Yii2

命令行安装Apache

1
2
3
4
5
6
sudo apt-get install apache2
cd /etc/apache2
sudo vi apache2.conf
sudo vi ports.conf
sudo /etc/init.d/apache2 status
sudo /etc/init.d/apache2 restart

apache2: Could not reliably determine the server’s fully qualified domain name,
… waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

1
2
3
sudo vim /etc/apache2/sites-available/000-default.conf
打开default文件后,在default文件顶端加入:
ServerName 127.0.0.1

端口扫描工具

1
2
3
4
5
6
#安装
sudo apt-get install nmap
#扫描本地端口
nmap localhost
sudo lsof -i :9999
sudo netstat -nap|grep

安装PHP

1
sudo apt-get install libapache2-mod-php5 php5

安装Yii2

1
2
3
4
wget https://github.com/yiisoft/yii2/releases/download/2.0.8/yii-advanced-app-2.0.8.tgz
sudo tar zxvf yii-advanced-app-2.0.8.tgz -C /var/www/
cd /var/www/advanced
php init
八宝粥 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!