PDA

View Full Version : Creating multiple sub-domains problem 1



shw
05-02-2007, 04:24 AM
I have 2 big questions about making multiple sub-domains, so will post them seperately.

We want to offer small mini-sites to our users and thought this would best be done by making self contained sub-domains.

I have followed other threads on how to do this properly and it has worked quite well. However, we have run into the following problems. I would greatly appreciate any assistance!

1. The sub-domains are set up in var/www/vhosts and have htaccess and cgi bins. The problem starts when restarting apache.
If I make the sub-domain add the htaccess and cgi and go on to make the next sub-domain then there is no problem. When you make the new sub-domain apache is restarted automatically and the stuff you put into httpd.config manually is saved.

The new entry looks like this:

<VirtualHost *>
ServerName my.subdomain1.com
ServerAlias www.my.subdomain1.com
DocumentRoot /var/www/vhosts/my/html
ScriptAlias /cgi-bin/ "/var/www/vhosts/my/cgi-bin/"
<Directory "/var/www/vhosts/my/html">
AllowOverride All
</Directory>
</VirtualHost>

The problems started when I wanted to finish for the day. So instead of making another new sub-domain I went to manager and pressed the restart apache button. Apache restarted.

All well and good - no - the problem is that I lost ftp access not only to the new subdomains but also the main domain. I can get up on ssh - but not ftp!!

"#%&! - But I had saved a copy of the http.config file so I put that back up. Only a few hours work lost... But that didn't correct the problem!

I tried this on another vps and got the same result. Now we have 2 vps with no ftp!

So...
Problem number 1 is that if I edit http.config and press the restart apache button in the site manager then I lose ftp! How do I get the ftp back?

Problem 2 follows shortly...

Cheers!
simon

wildjokerdesign
05-02-2007, 09:29 AM
What do you mean by "no FTP"? The reason I ask this is because when I do what you describe and I am logged into the site via FTP then make changes and restart the VPS via the Site Manager I get disconnected in my FTP program. That is normal and I simply reconnect. The program I use (WinSCP (http://winscp.net/eng/index.php) ) actually pops up a warning that I was disconnected and gives me the option to reconnect.

shw
05-02-2007, 10:55 AM
Thank you wildjokerdesign for taking an interest in my problem. If I remember correctly it was by following your instructions that I managed to solve the initial htaccess problem!

But back to the present problem...
I also use WinSPC and have no problem connecting with that. The problem is with HTML kit. We use that extensively. It is especially useful for tasks like editing the httpd.config file. Neither my colleague nor I can connect to either of the vpss now affected with HTML kit.

When I put back the older version of the httpd.config file I used WinSPC to overwrite the copy on the server. But this had no effect.

/S

wildjokerdesign
05-02-2007, 05:03 PM
I am afraid I am not familiar with "HTML kit". Could you point me to some information on it?

Update: Never mind I found your link in the other post. :) I don't have time today but well take a look tomorrow and see what I can find out.

wildjokerdesign
05-03-2007, 07:09 AM
I had a look at HTML Kit and could not see anything that would keep it from connecting to your site. If FTP works useing WinSCP then I can't figure out why HTML Kit won't. Is this when you try to connect to the sub domain or when you are useing the main user information? What types of errors are you getting if any.

rolling
05-03-2007, 09:11 AM
HTML-Kit uses a simple FTP Client to upload your files.

What happens if you try to telnet to your server? From the command prompt type telnet my.subdomain1.com 21. The reply should be something like

220 mydomain.com FTP server (Version wu-2.6.2(1) Mon Aug 16 17:10:57 IDT 2004) ready.
If not, then the error message should help. Just type Control-C to exit

Alternatively, just post the output from HTML-Kit's workspace. Here's what mine looks like (Initial directory = /var/log, Passive Mode enabled)


FTP < 220 mydomain.com FTP server (Version wu-2.6.2(1) Mon Aug 16 17:10:57 IDT 2004) ready.
FTP > USER mylogin
FTP < 331 Password required for mylogin.
FTP > PASS ***
FTP < 230 User mylogin logged in.
FTP > CWD /var/log
FTP < 250 CWD command successful.
FTP > SYST
FTP < 215 UNIX Type: L8
FTP > PWD
FTP < 257 "/var/log" is current directory.
FTP > PASV
FTP < 227 Entering Passive Mode (xxx,xxx,xxx,xxx,xxx,xxx)
FTP > LIST
FTP < 150 Opening ASCII mode data connection for /bin/ls.
FTP < 226 Transfer complete.
FTP > CWD /var/log
FTP < 250 CWD command successful.
The FTP service on your server is run by root on your VPS; we do not have individual access to its configuration; this is proably why you have to add you subdomains from the site manager (see your other post). Rather than running all the time, it is normal for FTP to be run as a service by the likes of inetd or xinetd so that the FTP server is only run when needed; this helps to conserve system resources. It sounds as though your server has problems starting the FTP service. WinSCP communicates to your server via port 22 rather than port 21. Maybe that's the issue. You haven't implemented any IP Filters or edited /etc/hd/ipf/p21 have you?

Finally, editing httpd.conf should have no effect on your FTP server as it is responsible for Apache and communications via ports 80 (HTTP) and 443 (HTTPS).

I did have a few problems with FTP, SMTP and POP services failing when my account was first setup. I submitted a support ticket every time that I had a problem and have had no problems in the last year.

shw
05-03-2007, 04:48 PM
Thank you for your input Richard.

Your conclusion looks to be similar to the one I had come to. The question is how to sort it out. But now we have isolated the problem I know what to tell support.

As I said earlier I don't have a problem with ssh. WinSCP connects via port 22 i.e. ssh.
My problem is with port 21 or ftp. HTML kit uses, as you point out, port 21.

Actually I am quite sure the problem is port 21 rather than ssh or ftp because if I try to connect via a ssh tunnel - ftp over ssh - this should connect via port 21 - but I don't get a connection.

The fact of the matter is that I replicated the problem on a second vps (now why did I do that :confused: ). So I am quite sure that the problem started when I changed the httpd.config file and pressed the restart apache button. Now you inform me that the httpd.config file should have no effect which explains why using a backup had no effect.

So my conclusion is the same as yours - and it makes sense to me now you inform me that ftp only runs when needed - for some reason I have managed to stop the vps starting the ftp service. It doesn't start when needed!

My last question on this matter is: if I have managed to do the same thing twice, why doesn't anyone else have the same problem :confused:

rolling
05-03-2007, 05:54 PM
Are both your VPSs on the same server? You can find out which server you are on from your site manager login page. Look at the URL in your browser's address bar.

If you are on Westhost 3.0, then your server name will begin wsl06... for example: https://wsl06001.west-datacenter.net
If you are on westhost 2.0, then your server name will begin wdclnx... for example: https://wdclnx86.west-datacenter.net

Please open a support ticket (http://members.westhost.com/contactus.html) for this so that the matter gets escalated. Since the problem is repeatable, it should be fixable :)

shw
05-03-2007, 06:05 PM
The numbers I get are:

wdclx114
wdclnx79

Are these both the same server?

rolling
05-04-2007, 03:50 AM
No. If they were on the same server then you would get the same wdclnx.. for both. One of your sites is on server 79, the other on server 114

shw
05-04-2007, 04:17 AM
Thank you Shawn and Richard for helping me isolate the problem. Now I will take it to support.

Simon

shw
05-06-2007, 04:49 AM
Now I have been in touch with support and the problems are resolved.

However, I still think there is some kind of glitch with the restart button, so what I will do in future is restart apache in another way e.g. making an extra sub-domain. When I have done it this way before I had no problems. I will leave the restart button well alone...

Thanks for all the help
Simon