Virtulamin setup and running but a few problems

13 posts / 0 new
Last post
#1 Fri, 12/21/2012 - 09:44
recci

Virtulamin setup and running but a few problems

Hi

I have managed to get a VPS setup and running with virtualmin/webmin using the automated install script.

My VPS is using: Ubuntu 12.04 64bit.

I registered my own nameservers at godaddy where my domains are as:

ns1.harmlesshosting.co.uk ns2.harmlesshosting.co.uk

but my vps only has one ip addess and I just used it for both. Is this going to be a problem? Anyway they seem to be resolving ok.

I have added two virtual servers in virtualmin and both domains seem to be resolving to their httpdocs folder ok.

The first of my problems is with the mx records, I am getting the following warning:

Warning - errors were found in this domain's DNS records : This domain has email enabled, but none of the MX records mail.harmlesshosting.co.uk point to it. Either the MX records should be corrected, or the email feature disabled if mail is hosted externally.

and my mx records do seem to be pointing to godaddy and not my vps.

host -t mx harmlesshosting.co.uk

harmlesshosting.co.uk mail is handled by 0 smtp.secureserver.net. harmlesshosting.co.uk mail is handled by 10 mailstore1.secureserver.net.

host mail.harmlesshosting.co.uk

mail.harmlesshosting.co.uk is an alias for pop.secureserver.net. pop.secureserver.net is an alias for pop.where.secureserver.net. pop.where.secureserver.net has address 64.202.165.92

To be honest I am pretty clueless about mx records! I have attached a screen shot of my dns records for the domain. How do I add the correct mx records to sort this out?

Also I am not sure how to add a new domain email address such as admin@harmlesshosting.co.uk and have all server related mail go their? I need my email to be reliable on this server.

The second of my problems is with mod-rewrite. I seen that the module was enabled in the Configure Apache Modules but it does not seem to be enabled inside each virtual server, how do I enabled it for each virtual server? as this is essential for my websites.

And lastly I managed to get joomla installed on one of the virtual servers but I noticed during the setup that it would not connect to the database with the virtual server username and password I had to use root and my root password. This obviously isn't right?

Fri, 12/21/2012 - 10:01
andreychek

Howdy,

but my vps only has one ip addess and I just used it for both. Is this going to be a problem? Anyway they seem to be resolving ok.

That should be just fine, and is a common setup.

and my mx records do seem to be pointing to godaddy and not my vps.

Where do you want email to go? Your server, or GoDaddy?

The second of my problems is with mod-rewrite. I seen that the module was enabled in the Configure Apache Modules but it does not seem to be enabled inside each virtual server, how do I enabled it for each virtual server? as this is essential for my websites.

The mod_rewrite module should be available to every Virtual Server. You can use that in Apache, or a .htaccess file. You may simple need to set "Rewrite Engine On" prior to using rewrite directives.

And lastly I managed to get joomla installed on one of the virtual servers but I noticed during the setup that it would not connect to the database with the virtual server username and password I had to use root and my root password. This obviously isn't right?

Did you by chance enable password hashing when setting up Virtualmin?

If so, you'd need to go into Edit Databases in Virtualmin in order to obtain your MySQL password, which will be randomly generated.

-Eric

Fri, 12/21/2012 - 11:27 (Reply to #2)
recci

Hi thanks for the reply,

I want the email to go to my vps unless going to godaddy would be the safer option?

The mod_rewrite doesn't seem to be working on every server tho. I have Rewrite Engine On and rewrite rules set up already in the .htaccess but its throwing up 500 Internal Server Errors. Is there any way to swirch it on in an indivdual virtual server? or determine if something else is wrong?

Nope never enabled password hashing during setup.

Fri, 12/21/2012 - 11:47 (Reply to #3)
recci

I see you wrote in another post:

Also, note that for mod_rewrite to work, each VirtualHost block in the Apache config that needs to use mod_rewrite needs to have "Allowoverride None" set.

How do I check and change this if required?

Fri, 12/21/2012 - 12:23
andreychek

Alright, there's a lot of questions here, so it's probably best to deal with them one at a time :-)

Let's start with mod_rewrite, that's simpler :-)

You would not want "Allowoverride None" set, that would prevent .htaccess files from working at all.

What error(s) do you see in $HOME/logs/error_log when using mod_rewrite?

-Eric

Fri, 12/21/2012 - 13:30
feronso

Hi Recci,

Its just simple, i just experience this issue before 2 days because i also setup my own VPS.

Apache by default not allow rewrite engine on for virtualHost. so you must define that in every virtualhost directory.

Here is mine working directory of virtualhost.

SuexecUserGroup "#500" "#500"
ServerAdmin root@localhost
DocumentRoot /home/domain.com/public_html

Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All

ServerName domain.com
ServerAlias www.domain.com
ErrorLog /home/domain.com/logs/error.log
LogLevel emerg
CustomLog /home/domain.com/logs/access.log "combined"

You noticed that i placed "AllowOverride All" within directory. so you just copy from "Options to AllowOverride All" and past this in "

Fri, 12/21/2012 - 13:49 (Reply to #6)
recci

andy: How do I see those logs? your dealing with a total noob here

feronso: Am I editing that file in virtualmin or via ssh?

Fri, 12/21/2012 - 14:22
andreychek

One way to view the logs is from within Virtualmin; you can do that by clicking Logs and Reports -> Apache Error Log.

-Eric

Sun, 12/23/2012 - 16:26
recci

All I am getting in the error logs is lots of /public_html/.htaccess: Option FollowSymLinks not allowed here

Sun, 12/23/2012 - 16:52
recci

ok editied the apache config for the indivial virtual hosts, over ride rule had options attached:

AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

I deleted the options and just left AllowOverride All and it seemed to work.

The mx record issues seems to have gone away by itself.

Have a look at: http://www.intodns.com/harmlesshosting.co.uk for me and see if anything looks out of place?

Sun, 12/23/2012 - 21:51
andreychek

Howdy,

For security reasons, I would highly recommend keeping your original Apache config -- and in the .htaccess file it mentions, I would change "FollowSymLinks" to "SymLinksIfOwnerMatch".

Using "FollowSymLinks" enables a rather large security hole :-/

Your DNS records look good though.

-Eric

Mon, 12/24/2012 - 12:22 (Reply to #11)
recci

Ok that worked sweet! So my vps seems to be working fine, Iv got email working and Iv hardened security a bit by adding a new admin user and disabling root ssh logins, changed the ssh port and installed fail2ban and logwatch.

As far as keeping my vps up-to-date and secure should I just install the virtualmin/webmin updates as they come?

Will updating my ubuntu installation via this route have any effect on my virtualmin installation?

$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get dist-upgrade

Mon, 12/24/2012 - 14:24
Locutus

Update/upgrade is fine and very much recommended! There's a package "unattended-upgrades" which can install security fixes automatically.

I personally don't recommend using the dist-upgrade function. It can work okay, but it's too much of a game of chance for my taste. :) It's similar to live-updating Windows XP to Windows 7. I prefer a clean new installation in that case.

But you wrote that you have Ubuntu 12.04 installed? That's the most recent LTS version and you should not need a dist-upgrade for some years. :)

Merry Christmas too!

Topic locked