linux服务器配置端口,Linux服务器配置-新增端口
1、我們需要知道操作的Apache配置文件在Linux服務(wù)器上面的路徑:
/etc/apache2/,用cd命令即可:cd /etc/apache2/
在服務(wù)器上,我們通過ls命令查看配置文件:
2、需要用到的是設(shè)置端口的文件ports.conf 以及sites-enabled目錄下面的000-default即可。
3、在ports.conf文件里面添加:這里面添加了兩個端口,分別是10003和10001,如果需要一個,添加一個。
NameVirtualHost *:10003
Listen 10003
NameVirtualHost *:10001
Listen 10001
4、完成后,接下來改變000-default文件設(shè)置:
ServerAdmin webmaster@localhost
DocumentRoot /home/www%修改的目錄
Options FollowSymLinks
AllowOverride None
%修改的目錄
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /php/ "/home/www/cgi-bin"
AllowOverride None
AddHandler cgi-script .py .sh .cgi .pl .asp .c
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ScriptAlias /php/ "/home/www/web"
AllowOverride None
AddHandler cgi-script .py .sh .cgi .pl .asp .c
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
5.別忘了重啟Apache ?/etc/init.d/apache2 restart,這樣就可以訪問端口了.
有時訪問時還是會出現(xiàn)問題,不能連接server,需要修改apache2.conf文件中的部分:
Options FollowSymLinks
AllowOverride None
Require all denied
修改為:
Options Indexes FollowSymLinks
AllowOverride None
# ? ? ? Require all denied
總結(jié)
以上是生活随笔為你收集整理的linux服务器配置端口,Linux服务器配置-新增端口的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue之filter用法
- 下一篇: linux下用户操作