Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having problems with setting up Apache2 server. I must say I'm completely a newbie. I'd be gladfull if you could help me.

  1. What's the best of way organizing Apache2 config files? I'm using Debian Lenny, and there are a lot of config files(apache2.conf, httpd.conf, ports.conf, sites-available etc...) in different places and I find it quite difficult to set up.

  2. I want to access to phpmyadmin and some other administrator softwares(ISPConfig etc) via admin.example.com subdomain(for example; admin.example.com/phpmyadmin, admin.example.com/ispconfig) but I want this subdomain to be accessible only via ssh so I've tried the following and some other examples that I've found on the internet for phpmyadmin (phpmyadmin.conf) but it's not working.

<Directory /usr/share/phpmyadmin>
AllowOverride None
Order deny,allow 
Deny from all
Allow from 127.0.0.1
share|improve this question

1 Answer 1

On Debian you should organise your configuration files as Debian expects you to, the most important thing in this case for you is going to be the VirtualHosts.

These should go in sites-available as individual files (with one or more VirtualHosts per file). You can then enable the VirtualHost with a2ensite.

To make a site only available via SSH I usually make a VirtualHost that only listens for connections to localhost, eg:

<VirtualHost *:80>
ServerName localhost

DocumentRoot /var/www/html/

<Directory /var/www/html/>
    Allow from 127.0.0.1
    Deny from all
    Options FollowSymLinks Indexes
    AllowOverride None
</Directory>
</VirtualHost>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.