Spencer M's picture

Fairly new to Turnkey and pretty new to Linux. I'm looking after a Turnkey LAMP server that is soon to be going live with it's first site. Being on the security side of the industry I'd like to secure the access to the Server admin a little more. Currently you can get to the initial control panel on tcp port 80 (http) and 443 (https with self sign cert). I'd like to change that to the control panel works on port 8000 and the secure access is on 4443.

What I've tried: -

I edited ports.conf and added listen 8000 and Listen 4443.

I copied all files and directories from /var/www/* to /var/www/siteadmin/

I edited /sites-available/default and change it to the following: -

NameVirtualHost *:8000
NameVirtualHost *:4443

<VirtualHost *:8000>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/serveradmin
</VirtualHost>
<VirtualHost *:4443>
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/cert.pem
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/serveradmin
</VirtualHost>
ScriptAlias /cgi-bin/ /var/www/serveradmin/cgi-bin/
<Directory /var/www/serveradmin>
        Options Indexes FollowSymLinks MultiViews
        Order allow,deny
        allow from all
</Directory>
 
My plan was to then add an apache virtual server *:80 and *:443 and then add server name virtual servers.
 
My problem is that when I change the default values of the admin control panel the webmin link is then seen as http://x.x.x.x:8000:12321 which fails.
 
Any ideas welcome
Forum: 
lockd's picture

I've had same problems too. I solved the problem by changing the following locations in index.php file. $_SERVER{'HTTP_HOST'}; ?>:12321"><img  $_SERVER{'SERVER_NAME'}; ?>:12321"><img

Add new comment