I'm running Ubuntu 11.10 x64 Server, with apache2 installed. The setup is pretty much default configuration.

I have a few questions about;

DocumentRoot/Static IP/Connect from LAN/SSH or FTP?/Firewall ports services

  • I changed the default DocumentRoot location in the configuration file from sites-available to /srv/www/000 from /var/www.

    Even though I changed DocumentRoot to the new location, in that same .conf file there are tags with <directory /var/www/> </directory> which were there by default, should I correct this, or should I only worry about changing DocumentRoot.

  • How can I change my ip address to a non-DHCP static ip? (I'm talking LAN) I want to know how I can connect to Apache server from another computer on LAN, but also make sure Apache isn't reachable from WAN. (I'm not sure if it could be even be reach from WAN)
  • Its my first time really messing with the configuration of Apache, I usually leave it at its defaults and just mess in /var/www. Since I'm not using a GUI or web browser, I can't program and check my work from the local machine, I need to access the webserver from another computer on LAN, how can I do this?
  • I have no experience setting up or using SSH, but I'd like to create a group for SSH put my user in it, change the permissions for /srv/www/000 for this group to edit only and allow SSH to /srv/www/000 or, should I try installing an FTP server?
  • If the only services that will be running on this server are apache2, php5, mysql, SSH or FTP. How can I check for other services that I might not need, and check for ports which are opened and I might not need running. I'm not going to make this server public to the web, but I'd like the experience of locking it down the right way anyway.

Thank you for reading - I apprentice any advice.

1 Answer 1


ad 1)

Every site have to have own DocumentRoot variable set...

ad 2)

You have to stop dhclient for LAN interface:

ifdown eth1

(I pretend, that LAN interface is eth1)

Then you have to edit file /etc/network/interfaces in this way:

auto eth1
iface eth1 inet static

Please, use right values, this is only example, which values you have to fill...

And then you have to set dns server in file /etc/resolv.conf:

search your.domain

(after server you have to add IP address of your dns server).

Then you can do:

ifup eth1

And you will have static IP address.

Ad 3) and 4)

I can recommend to you to have a DocumentRoot set to your /home/username/html directory and for uploading a web pages use WinSCP program. It is similar as TotalCommander, for example, and can handle SCP in very good way. FTP server is not very secure... But if you would like use one, you can try a vsftpd package.

Ad 5)


netstat -tpln

for services, which are using tcp, for udp services you can use:

netstat -upln
  • If resolvconf is installed, you need to add dns-nameservers to /etc/interface instead of changing /etc/resolv.conf. See wiki.ubuntuusers.de/interfaces for more information
    – jofel
    Commented Feb 22, 2012 at 12:32
  • @jofel I know about it, but you must pretend, that there is resolvconf installed and my solution is universal.
    – Jan Marek
    Commented Feb 22, 2012 at 13:00
  • 1
    Your solution is in that way not universal, since for the case resolvconf or openresolv is installed, /etc/resolv.conf is overwritten by it regularly, so editing it is not permanent. Of course, if resolvconf/openresolv is not installed, your solution is the right one.
    – jofel
    Commented Feb 22, 2012 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .