View previous topic :: View next topic |
Author |
Message |
amit3 Junior Member
Joined: 09 Apr 2012 Posts: 15
|
Posted: Tue Apr 17, 2012 9:44 pm Post subject: Problems with virtual hosts and ftp |
|
|
1. I have very slow FTP transfer rate not more than 40-100 Kb/s inside my home local network from my comp to SMS-server (Ethernet 10/100). Samba shows good 8-9 MB/s performance.
Why is it so?
2. Have some complications with creating virtual hosts. I want to have two sites on my single IP, and for this purpose I have created directories:
/home/www/test1 - with some index.php inside for testing (chmod to 777 folder and file)
/home/www/test2 - …
Then I Webmin –> Servers –> Apache Webserver –> Create virtual hosts. There: Document root =/home/www/test1 Server name= test1
Same way I did second virt serv. Restarted apache.
Then in browser I input:
localhost - and see Unable to connect
test1 – error, I see redirection to google
test2 – error
192.168.71.130 - see SMS logo with phpmyadmin and e.t.c… - it is the default local network address of my SMS-server
When installing SMS I have set hostname = localhost, domain name = dom
My file /etc/hosts is:
127.0.0.1 localhost
127.0.0.1 localhost.dom localhost
So I cannot access my sites from browser.
Please help. |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Wed Apr 18, 2012 3:18 pm Post subject: |
|
|
1. try replacing transfer rates at /etc/proftpd.cof
http://sms.it-ccs.com/forum/viewtopic.php?p=2419#2419
2. You need to edit /etc/httpd/extra/httpd-vhosts.conf
and uncomment
#Include /etc/httpd/extra/httpd-vhosts.conf
in your httpd.conf.
Also you need a proper DNS for this to work, or edit /etc/hosts to test locally.
You can test syntax with
"httpd -S"
Here is an example... don't forget to create logs directory under /home/www/test[12]
Code: | NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin root@localhost.dom
ServerName test1.localhost.dom
ServerAlias test1.localhost.dom
DocumentRoot "/home/www/test1/"
ErrorLog /home/www/test1/logs/error.log
CustomLog /home/www/test1/logs/access.log combined
<Directory "/home/www/test1/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost.dom
ServerName test2.localhost.dom
ServerAlias test2.localhost.dom
DocumentRoot "/home/www/test2/"
ErrorLog /home/www/test2/logs/error.log
CustomLog /home/www/test2/logs/access.log combined
<Directory "/home/www/test2/">
allow from all
Options +Indexes
</Directory>
</VirtualHost> |
add in your /etc/hosts
Code: | 127.0.0.1 test1.localhost.dom test1
127.0.0.1 test2.localhost.dom test2 |
restart apache and visit
test1.localhost.dom and test2.localhost.dom in your browser to check.
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
amit3 Junior Member
Joined: 09 Apr 2012 Posts: 15
|
Posted: Wed Apr 18, 2012 7:37 pm Post subject: |
|
|
I did as you described,
but
in browser:
test1.localhost.dom - Server not found
test1 - redirected me to google
localhost - redir to google
test2.localhost.dom - Server not found.....
192.168.71.130 - I see my site in /home/www/test1
And now cannot access to SMS logo with phpmyadmin and e.t.c..
# ping test1
64 bytes from localhost (127.0.0.1)... - OK
....
#ping test1.localhost.dom
64 bytes from localhost (127.0.0.1).... - OK
.....
Same test2 pings ok.
# httpd -S gives me:
*:80 is a NameVirtualhost
default server test1.localhost.dom....
port 80 namevhost test1.localhost.dom ....
port 80 namevhost test2.localhost.dom ....
Syntax OK |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Wed Apr 18, 2012 8:34 pm Post subject: |
|
|
Are you trying to view those from SMS machine?
If you are trying to see them from another machine it will not work, if you are not having a proper DNS setup.
You can try adding a master zone localhost.dom in bind, and add records for test1 and test2.
Wiki has an example it's simple.
http://sms.it-ccs.com/wiki/#LinkTarget_1332
Also don't forget to add at top of /etc/resolv.conf
nameserver 127.0.0.1
Apply configuration and test with
"dig test1.localhost.dom"
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
amit3 Junior Member
Joined: 09 Apr 2012 Posts: 15
|
Posted: Wed Apr 18, 2012 11:53 pm Post subject: |
|
|
Yes, I was trying to see them from another machine in my LAN...
Ok, thank you ) |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Thu Apr 19, 2012 5:15 am Post subject: |
|
|
Add your your machines in your client hosts then.
If it's a windows machine it's on
C:\windows\system32\drivers\etc\hosts
Code: | 192.168.71.130 test1.localhost.dom
192.168.71.130 test2.localhost.dom |
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
|