如何使用https访问webmin和phpmyadmin?

我在CentOS 6.4上安装了Apache,PHP和MySQL

我可以使用从我局域网上另一台PC上的SSH使用PuTTY访问服务器。

我刚刚安装webmin使用yum与webmin回购,并使用yum使用epel回购安装phpMyAdmin。

我可以使用http://localhost:10000http://192.168.0.1:10000直接从我的服务器访问webmin,但不能从我的局域网中的另一台PC访问:

我可以直接从我的服务器使用http://localhost:10000访问phpMyAdmin,但不能访问我局域网上的另一台PC,当访问http://192.168.0.1/phpmyadmin ,我得到了Forbidden, You don't have permision to access /phpmyadmin on this server. Apache/2.2.15 (CentOS) Server at 192.168.0.108 Port 80 Forbidden, You don't have permision to access /phpmyadmin on this server. Apache/2.2.15 (CentOS) Server at 192.168.0.108 Port 80

我曾经想过,我曾经使用https访问webmin,而不是http。

任何build议我应该如何解决? 谢谢

首先,如果您在端口10000上同时运行Webmin和PHPMyAdmin,则不应该这样做。 但是,最后我检查,PHPMyAdmin本身不直接绑定到一个接口。

对于PHPMyAdmin,你可以像使用其他的一样使用apacheconfiguration文件。 例如,这将通过一个子域运行PHPMyAdmin并强制使用SSL:

 <VirtualHost *:80> ServerName phpmyadmin.example.tld Redirect permanent / https://phpmyadmin.example.tld/ </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin [email protected] ServerName phpmyadmin.example.tld DocumentRoot /path/to/phpmyamin <Directory /> Options FollowSymlinks AllowOverride None </Directory> <Directory /path/to/phpmyadmin> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <Directory /path/to/phpmyadmin/libraries> Order Deny,Allow Deny from All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog \ ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile \ /etc/ssl/certs/yourcertificate.crt SSLCertificateKeyFile \ /etc/ssl/private/yourprivatekey.key SSLVerifyClient none SSLOptions +StrictRequire BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown SSLProtocol -all +TLSv1 +SSLv3 SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM SSLProxyEngine off <IfModule mime.c> AddType application/x-509-ca-cert .crt AddType application/x-pkcs7-crl .crl </IfModule> </VirtualHost> </IfModule> 

或者将运行PHPMyAdmin的虚拟主机configuration为正确使用SSL。

要将HTTPS与ProxyPass一起使用(在Webmin的情况下)同样适用,但添加以下内容以通过端口443提供:

 <IfModule mod_proxy.c> ProxyVia On ProxyRequests Off ProxyPass / https://webmin.example.tld:10000/ ProxyPassReverse / https://webmin.example.tld:10000/ ProxyPreserveHost on <Proxy *> Options FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Proxy> </IfModule> 

您应该首次find设置Apache的指南,例如: http : //httpd.apache.org/docs/2.2/install.html

这听起来像是你在configuration文件中遗漏了一些东西。