1

To increase security in my server I created an subdomain only for admin, like admin.domain.tld and usually i access phpmyadmin by going only at admin.domain.tld/mysqladmin as in config file:

<VirtualHost *:80> ServerName admin.domain.tld Alias /mysqladmin /usr/share/phpMyAdmin/ <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 AllowOverride All [...] </VirtualHost> 

now that I have have a subdomain i want to SSL secure it, for that i need to configure a virtual host or something like, (i use certbot aka let's encrypt), but as i have to configure a virtual host i decided to create a admin only html page in admin.domain.tld containing links to my admin pages like phpmyadmin, joomla admin page, etc...

config file:

 ServerName admin.domain.tld DocumentRoot /var/www/admin.domain.tld ErrorLog /var/log/httpd/admin.domain.tld/error.log <Directory /var/www/admin.domain.tld> Options FollowSymLinks Indexes AllowOverride All </Directory> 

but now when i go to admin.domain.tld/mysqladmin i get an error:

The requested URL /mysqladmin/ was not found on this server. 

So, how can i get it working like this:

admin.domain.tld is /var/www/admin.domain.tld
and
admin.domain.tld/mysqladmin is phpmyadmin

EDIT: i guess my problem is the alias is not working so when i go to admin.domain.tld it shows /var/www/admin.domain.tld/mysqladmin instead of /usr/share/phpMyAdmin

2
  • Did you put the alias in? You've only shown it here for the non-https virtual host. Commented May 24, 2016 at 22:53
  • @yoonix i didn't secured it with ssl yet... Commented May 24, 2016 at 22:55

2 Answers 2

1

You are doing a loop in the first config. You send the alias to the same root directory, so when call the alias, will display the same root directory. In that case, you will need a mysqladmin folder on /usr/share/phpMyAdmin/.

Try to use /var/www/admin.domain.tld to root directory in both config files, so the alias mysqladmin will forward to the phpmyadmin.

1
  • my problem is the alias is not working so when i go to admin.domain.tld it shows /var/www/admin.domain.tld/mysqladmin instead of /usr/share/phpMyAdmin Commented May 24, 2016 at 23:37
0

I managed to solve my problem by putting the content of phpmyadmin virtual host together with the one of the admin.domain.tld. like this:

<VirtualHost *:80> ServerName admin.domain.tld DocumentRoot /var/www/admin.domain.tld ErrorLog /var/log/httpd/admin.domain.tld/error.log <Directory /var/www/admin.domain.tld> Options FollowSymLinks Indexes AllowOverride All </Directory> Alias /mysqladmin /usr/share/phpMyAdmin <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 AllowOverride All [...] </VirtualHost> 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.