vi /etc/httpd/conf/httpd.conf
內容作以下修改,增長一個監聽端口來設置:laravel
Listen 82 <VirtualHost *:82> DocumentRoot /var/www/mylaravel/public </VirtualHost> <Directory "/var/www/mylaravel/public"> AllowOverride None Require all granted </Directory>
注意:若是你的apache上只跑一個站,能夠不用設置virtualHost,直接設置DocumentRoot就能夠了 這裏的設置是爲了解決單IP上80端口要跑一個已經存在的站,因此設置了vhostapache
systemctl restart httpd.service