Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

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
    address 192.168.1.50
    netmask 255.255.255.0
    broadcast 192.168.1.255
    network 192.168.1.0
    gateway 192.168.1.254

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
server 192.168.1.254

(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)

Use:

netstat -tpln

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

netstat -upln
share|improve this answer
    
If resolvconf is installed, you need to add dns-nameservers 192.168.1.254 to /etc/interface instead of changing /etc/resolv.conf. See wiki.ubuntuusers.de/interfaces for more information –  jofel Feb 22 '12 at 12:32
    
@jofel I know about it, but you must pretend, that there is resolvconf installed and my solution is universal. –  Jan Marek Feb 22 '12 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 Feb 22 '12 at 13:12

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.