Change Home Directory

17 posts / 0 new
Last post
#1 Thu, 11/29/2012 - 11:01
jamesallwood

Change Home Directory

Hi. Obviously because I'm posting in this category, I'm a complete newbie, so please accept my apologies if this question has a really obvious answer.

I've installed virtualmin on a machine that I run in my office for web development.

I followed a tutorial and all seemed well.

I changed www-data to reflect the new home directory (/home), but when I access the ip of the server it continues to point to var/www

What have I missed? I've restarted the machine to double check that I'd saved www-data and it all looks good to me.

I've also doubled checked that I've enabled suexec within webmin.

Any help would be really appreciated.

Thanks.

Thu, 11/29/2012 - 12:16
andreychek

Howdy,

Hmm, what distribution/version are you using?

And how did you perform your Virtualmin installation, did you by chance use the install.sh script?

-Eric

Thu, 11/29/2012 - 15:40
Locutus

I've lately seen some "tutorials" which indeed perform the Virtualmin installation the manual way. Especially as a newbie, I highly recommend not following those, but using the installer script, like Eric mentioned. It will save you a lot of trouble and grey hair. ;)

Fri, 11/30/2012 - 03:18 (Reply to #3)
jamesallwood

Morning. Thanks for your replies.

I followed a tutorial for a manual installation, and didn't even realise that there was a install script until I start researching this problem.

Can I run the install script now that I've manually installed, or do I need to uninstall first?

This is the first time I've setup my own server, and I'm really exceited to get it working properly.

Thanks for your advice.

James

Fri, 11/30/2012 - 03:25
Locutus

Hehe, I know how that feels.

To use the installer script, it is advised to do that only on a bare system, freshly installed, with only SSH as additional package. So if you can, you should reinstall the system.

Fri, 11/30/2012 - 04:55
jamesallwood

Ok, so I've just performed a fresh install of Ubuntu and then ran the install script, but it failed.

I've attached the error log. Doesn't make much sense to me.

Again, any help would be really appreciated.

Thanks

Fri, 11/30/2012 - 06:23
Locutus

Uh-oh, several unfortunate things in there.

  1. It is suggested to only use the LTS versions of Ubuntu, since only those are fully supported (and will get updates for a sufficiently long period). Those are 8.04, 10.04 and 12.04.

  2. Your system should have a fully qualified hostname, like "host.domain.tld". To get that, you need to configure several files in /etc correctly. I can list those when required. You can test validity using the command hostname which should reply with just a hostname, and hostname -f and hostname -A which should both reply with the identical FQDN (hostname plus domain). Example from my mail hosting VM:

root@australis:~# hostname
australis
root@australis:~# hostname -f
australis.tianet.de
root@australis:~# hostname -A
australis.tianet.de
  1. You seem to be operating behind a NAT router, according to your 192.168.* address. Additional steps need to be done to get that up and running correctly. Namely several ports need to be forwarded (25, 80, 443, 110, 143, 995, 997, 21 and possibly others) and FTP needs special configuration.

  2. The fatal error might indicate that the system could not retrieve package updates. Make sure the system can correctly reach the Internet and the Ubuntu package repositories.

Fri, 11/30/2012 - 06:36
jamesallwood

Hi Locutus,

Thanks for your reply. Sorry for opening two threads, just thought that I'd diverted off topic with this new problem.

To be honest, I thought installing virtualmin would be pretty straightforward using the install script.

This is a fresh install of ubuntu sever 12.04 with only openssh installed.

I don't fully follow the purpose of having a hostname as this is only a local server, but I've checked and I have the same value for hostname, hostname -f, and hostname -A. How can I change this?

So I need to log in to my router to make those changes?

I can definitely access the internet fine through the server as I've just ran the updates.

Just wondering if I should bother with virtualmin or just stick to manually managing the server?

Thanks

James

Fri, 11/30/2012 - 06:59
Locutus

Virtualmin should work fine also behind a router at home. Though having an FQDN for your server would be very preferable, since it makes things much easier. To be honest, I have never used Vmin without an FQDN, and don't know precisely what problem will arise where if you don't have one.

To acquire one for your home server, all you need is an externally resolvable FQDN of the form "host.domain.tld". You could use any number of free (dynamic) DNS providers for that, e.g. dyndns.org. You'll need that - i.e. a static FQDN - anyway if you intend to receive email from the Internet.

On your server, the important files in /etc are "hosts", "hostname" and "mailname". If you set those correctly before running the script, all should be okay. Mine look like this:

root@australis:~# cat /etc/hostname
australis
root@australis:~# cat /etc/hosts
176.9.191.26    australis.tianet.de     australis
root@australis:~# cat /etc/mailname
australis.tianet.de

Note that "hosts" contains more lines, I pasted only the relevant one. If you enter the hostname and domain part during Ubuntu installation, those things should be correct already. On your router you should not need to change anything.

Fri, 11/30/2012 - 07:26
jamesallwood

Thanks for that information Locutus.

I've signed up for an account and I now have these as my hosts -

root@webtise:/# hostname webtise root@webtise:/# hostname -f webtise.no-ip.org root@webtise:/# hostname -A webtise.no-ip.org

I then tried running /bin/sh install.sh and still had an error. I've attached the full readout in a text file

Fri, 11/30/2012 - 08:19
Locutus

Okay, the hostname looks good now!

During installation, it would seem that the script, or rather the invoked apt-get command, cannot download several packages.

Before we go into this further: I can see that you're still using Ubuntu 12.10. It is possible that there are some compatibility issues, since that version is not officially supported. It's generally not recommended to use bleeding-edge versions of Linux distros for servers. Can't say much more about this unfortunately, since I'm only using LTS versions. :)

Can you try Ubuntu 12.04? I'm using that version myself and know that it works okay.

Fri, 11/30/2012 - 08:26
andreychek

Howdy,

This is a fresh install of ubuntu sever 12.04 with only openssh installed.

Just to add to what Locutus mentioned -- although it may have been your intention to install Ubuntu 12.04, it really does look like you have Ubuntu 12.10 there. The Virtualmin installer outputs the Ubuntu version it sees, and your error message contains "Ubuntu 12.10" in the text.

My suggestion would be to try downloading the 12.04 install CD's again, and then redo your install.

The Virtualmin installer should work great on Ubuntu 12.04.

-Eric

Fri, 11/30/2012 - 10:21
jamesallwood

Hi All.

Well it looked like I'd make the completely amateur site of installing the wrong version of Ubuntu. I've now installed 12.04 and virtualmin installed just great! Hoorah. Thanks for your help.

I've set up a virtual server now, just need to work out how to access it from the frontend. Thought it would be

192.168.0.30/accountname

but that doesn't work, any ideas?

Thanks

James

Fri, 11/30/2012 - 10:59
Locutus

Yepp, thanks Eric, I forgot to mention that I spotted the 12.10 in the error log. :)

What do you mean with "access it from the frontend"? As in, log in to Virtualmin as the vserver owner? Or watch the vserver's web contents?

If the former, you access Virtualmin like usual, at https://ip:10000 and enter the username and password of the vserver at the login. (Vmin uses Linux users for its login, and one of those gets created whenever you set up a virtual server.)

Mon, 12/03/2012 - 05:59
jamesallwood

Morning,

Sorry for the delay.

Ok, so for example, lets say I've set up a new virtual server in virtualmin, and called it "mydomain.com".

From my local network, how can I preview this site?

192.168.0.30/mydomain.com 192.168.0.30/~mydomain.com

This is probably a really stupid question, so apologies in advance.

Thanks

James

Mon, 12/03/2012 - 06:28
Locutus

Your Virtualmin will probably use your external IP in the DNS zone. So if you want to preview the website like a visitor from the outside would see it, you need to a) enter your Virtualmin server's IP as nameserver into your local network PC's network configuration, and b) make sure your router forwards connections to its external IP, also from the internal network, to the right LAN machine (this is call "NAT reflection").

Otherwise, Virtualmin has a Preview function of its own, check the "Services" menu.

Mon, 12/03/2012 - 08:08
andreychek

Howdy,

Also, rather than using IP addresses, I'd recommend setting up a domain name on your server.

You can do that for all your accounts with just one domain name... there's details on setting that up here in the section titled "How do I make a users website available at "http://www.mydomain.tld/~username":

http://www.virtualmin.com/documentation/web/faq

Topic locked