#1  
Old 17th April 2011, 15:54
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default Vhosting question

Hi folks

host - ubunut 1010 desktop 64bit
virtualizer - VirtualBox ver 3.2.10 r66523
guest (VM) - ubuntu 1010 server 64bit

I followed;
Creating Simple Virtual Hosts With mod_mysql_vhost On Lighttpd
http://www.howtoforge.com/creating-s...pd-debian-etch

to setup virtual hosting.

example.com = a registered domain
example.org = a free subdomain on "http://freedns.afraid.org/subdomain/"
(I don't have another registered domain for this testing)

Both domain points to the same public IP. The public IP is also forwarded to the local IP of the VM.

Installation went through w/o much problem. After finish "example.com" works without problem. However example.org can't be browsed.

On console ping both domains working.

Please shed me some light where to check? TIA

B.R.
satimis

Last edited by satimis; 17th April 2011 at 15:57.
Reply With Quote
Sponsored Links
  #2  
Old 18th April 2011, 09:57
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Are there any errors in the Lighttpd error log?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 18th April 2011, 11:37
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by falko View Post
Are there any errors in the Lighttpd error log?
Hi falko,

No. Your How-to is perfect. What made me spending hours without a breakthrough is the subdomain registered on;

http://freedns.afraid.org/

I can ping the subdomain registered but can't browse it. On their website the subdomain is pointing on the public IP (fixed) which in turn is forwarded to the local IP of the VM under testing. I googled around on Internet for cause in parallel generating a suspicion that vhosting on lighttpd doesn't work on VM or not supporting vhosting on subdomain. I was stuck there. Then by chance I registered anther subdomain on;

http://changeip.net/

and set up the vhost according to the steps described on your How-to. It works seamlessly.

I still don't understand the cause of the first subdomain not working on lighttpd.

Thanks

Edit:

I'm now creating another VM according to your How-to to see what will happen.


B.R.
satimis
Reply With Quote
  #4  
Old 18th April 2011, 13:44
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default

Hi falko,

Have another round.

I'm stuck here;

1)
if
bind-address = 127.0.0.1

$ mysqladmin -h hostname -u root -p password mysqlpasswd
Enter password:
Code:
mysqladmin: connect to server at 'hostname' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111'
2)
if
bind-address=VM_local-IP
$ mysqladmin -h hostname -u root -p password mysqlpasswd
Enter password:
Code:
mysqladmin: connect to server at 'hostname' failed
error: 'Host 'hostname.satimis.com' is not allowed to connect to this MySQL server'
hostname is gererated by

$ hostname
or
$ hostname -a
both output being the same

NOT hostname.satimis.com (I can't resolve?)

Referring to previous notes setting the lighttpd server I have the same problem. Therefore I haven't created mysqladmin password.

Advice would be appreciated. TIA

B.R.
satimis
Reply With Quote
  #5  
Old 19th April 2011, 15:21
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Quote:
Originally Posted by satimis View Post
Hi falko,

Have another round.

I'm stuck here;

1)
if
bind-address = 127.0.0.1

$ mysqladmin -h hostname -u root -p password mysqlpasswd
Enter password:
Code:
mysqladmin: connect to server at 'hostname' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111'
2)
if
bind-address=VM_local-IP
$ mysqladmin -h hostname -u root -p password mysqlpasswd
Enter password:
Code:
mysqladmin: connect to server at 'hostname' failed
error: 'Host 'hostname.satimis.com' is not allowed to connect to this MySQL server'
hostname is gererated by

$ hostname
or
$ hostname -a
both output being the same

NOT hostname.satimis.com (I can't resolve?)

Referring to previous notes setting the lighttpd server I have the same problem. Therefore I haven't created mysqladmin password.

Advice would be appreciated. TIA

B.R.
satimis
Comment out the bind-address line and restart MySQL. Then run
Code:
dpkg-reconfigure mysql-server
This hsould ask you to set a password.


Quote:
I can ping the subdomain registered but can't browse it. On their website the subdomain is pointing on the public IP (fixed) which in turn is forwarded to the local IP of the VM under testing.
The domain must point directly to your router's public IP.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 19th April 2011, 17:48
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by falko View Post
Comment out the bind-address line and restart MySQL. Then run
Code:
dpkg-reconfigure mysql-server
This hsould ask you to set a password.
Comment out the line
Code:
bind-address = 127.0.0.1
# service mysql restart
Code:
mysql start/running, process 1367
# netstat -tap | grep mysql
Code:
tcp        0      0 *:mysql                 *:*                     LISTEN      1367/mysqld
# dpkg-reconfigure mysql-server
no printout (no response)

Quote:
The domain must point directly to your router's public IP.
Yes, on http://freedns.afraid.org/ website. The domain(subdomain) points to the public IP of the router.

Just create a new vhost for it. Still I can't browse it. Other domain and subdomain work without problem.

satimis
Reply With Quote
  #7  
Old 20th April 2011, 14:59
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Can you post the output of
Code:
ifconfig
and the vhost configuration of the not-working vhost?

Can you connect to MySQL if you leave out the
Code:
-h hostname
part?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 20th April 2011, 15:57
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by falko View Post
Can you post the output of
Code:
ifconfig
ifconfig
Code:
br0       Link encap:Ethernet  HWaddr 08:00:27:04:a9:83  
          inet addr:xxx.xxx.xxx.xxx  Bcast:x.x.x.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe04:a983/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2999 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2250 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:257698 (257.6 KB)  TX bytes:1588019 (1.5 MB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:04:a9:83  
          inet6 addr: fe80::a00:27ff:fe04:a983/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8073 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3045 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3387463 (3.3 MB)  TX bytes:1640493 (1.6 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Quote:
and the vhost configuration of the not-working vhost?
mysql> SELECT domain from domains;
Code:
+---------------------------+
| domain                    |
+---------------------------+
.....
| www.satimis.strangled.net |
+---------------------------+
mysql> SELECT docroot from domains;
Code:
+-----------------------------------------+
| docroot                                 |
+-----------------------------------------+
....
| /var/www/www.satimis.strangled.net/web/ |
+-----------------------------------------+
$ sudo ls -al /var/www/www.satimis.strangled.net/web/
total 12
Code:
drwxr-xr-x 2 root root 4096 2011-04-19 22:19 .
drwxr-xr-x 3 root root 4096 2011-04-19 22:16 ..
-rw-r--r-- 1 root root   26 2011-04-19 22:19 index.html
Quote:
Can you connect to MySQL if you leave out the
Code:
-h hostname
part?
Yes.

$ mysql -u root -p
Enter password:

satimis
Reply With Quote
  #9  
Old 21st April 2011, 14:45
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

I mean the vhost configiration file in the /etc/apache2/sites-available/ directory. Does it use the same IP address that is allocated to br0?


Quote:
Yes.

$ mysql -u root -p
Enter password:
This means that hostname is not listed in the mysql.user table. You're probably using a wrong hostname. Please check the mysql.user table.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 22nd April 2011, 05:20
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
 
Default

Quote:
Originally Posted by falko View Post
I mean the vhost configiration file in the /etc/apache2/sites-available/ directory. Does it use the same IP address that is allocated to br0?
Sorry, I'm testing lighttpd here

$ ls /etc/lighttpd/conf-available/
Code:
05-auth.conf       10-fastcgi.conf  10-simple-vhost.conf  10-userdir.conf
10-access.conf     10-no-www.conf   10-ssi.conf           15-fastcgi-php.conf
10-accesslog.conf  10-proxy.conf    10-ssl.conf           90-debian-doc.conf
10-cgi.conf        10-rrdtool.conf  10-status.conf        README
Which file I have to check? Thanks.

Quote:
This means that hostname is not listed in the mysql.user table. You're probably using a wrong hostname. Please check the mysql.user table.
mysql> USE mysql;

mysql> SHOW tables;
Code:
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| event                     |
| func                      |
| general_log               |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| ndb_binlog_index          |
| plugin                    |
| proc                      |
| procs_priv                |
| servers                   |
| slow_log                  |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
23 rows in set (0.00 sec)

mysql> SHOW COLUMNS FROM user;
Code:
+-----------------------+-----------------------------------+------+-----+---------+-------+
| Field                 | Type                              | Null | Key | Default | Extra |
+-----------------------+-----------------------------------+------+-----+---------+-------+
| Host                  | char(60)                          | NO   | PRI |         |       |
| User                  | char(16)                          | NO   | PRI |         |       |
| Password              | char(41)                          | NO   |     |         |       |
| Select_priv           | enum('N','Y')                     | NO   |     | N       |       |
| Insert_priv           | enum('N','Y')                     | NO   |     | N       |       |
| Update_priv           | enum('N','Y')                     | NO   |     | N       |       |
| Delete_priv           | enum('N','Y')                     | NO   |     | N       |       |
| Create_priv           | enum('N','Y')                     | NO   |     | N       |       |
| Drop_priv             | enum('N','Y')                     | NO   |     | N       |       |
| Reload_priv           | enum('N','Y')                     | NO   |     | N       |       |
| Shutdown_priv         | enum('N','Y')                     | NO   |     | N       |       |
| Process_priv          | enum('N','Y')                     | NO   |     | N       |       |
| File_priv             | enum('N','Y')                     | NO   |     | N       |       |
| Grant_priv            | enum('N','Y')                     | NO   |     | N       |       |
| References_priv       | enum('N','Y')                     | NO   |     | N       |       |
| Index_priv            | enum('N','Y')                     | NO   |     | N       |       |
| Alter_priv            | enum('N','Y')                     | NO   |     | N       |       |
| Show_db_priv          | enum('N','Y')                     | NO   |     | N       |       |
| Super_priv            | enum('N','Y')                     | NO   |     | N       |       |
| Create_tmp_table_priv | enum('N','Y')                     | NO   |     | N       |       |
| Lock_tables_priv      | enum('N','Y')                     | NO   |     | N       |       |
| Execute_priv          | enum('N','Y')                     | NO   |     | N       |       |
| Repl_slave_priv       | enum('N','Y')                     | NO   |     | N       |       |
| Repl_client_priv      | enum('N','Y')                     | NO   |     | N       |       |
| Create_view_priv      | enum('N','Y')                     | NO   |     | N       |       |
| Show_view_priv        | enum('N','Y')                     | NO   |     | N       |       |
| Create_routine_priv   | enum('N','Y')                     | NO   |     | N       |       |
| Alter_routine_priv    | enum('N','Y')                     | NO   |     | N       |       |
| Create_user_priv      | enum('N','Y')                     | NO   |     | N       |       |
| Event_priv            | enum('N','Y')                     | NO   |     | N       |       |
| Trigger_priv          | enum('N','Y')                     | NO   |     | N       |       |
| ssl_type              | enum('','ANY','X509','SPECIFIED') | NO   |     |         |       |
| ssl_cipher            | blob                              | NO   |     | NULL    |       |
| x509_issuer           | blob                              | NO   |     | NULL    |       |
| x509_subject          | blob                              | NO   |     | NULL    |       |
| max_questions         | int(11) unsigned                  | NO   |     | 0       |       |
| max_updates           | int(11) unsigned                  | NO   |     | 0       |       |
| max_connections       | int(11) unsigned                  | NO   |     | 0       |       |
| max_user_connections  | int(11) unsigned                  | NO   |     | 0       |       |
+-----------------------+-----------------------------------+------+-----+---------+-------+
39 rows in set (0.00 sec)

mysql> SELECT Host from user;
Code:
+-----------------------+
| Host                  |
+-----------------------+
| 127.0.0.1             |
| localhost             |
| localhost             |
| localhost             |
| localhost.localdomain |
| ub1010ser02           |
+-----------------------+
6 rows in set (0.00 sec)
$ hostname
Code:
ub1010ser02
$ hostname -a
Code:
ub1010ser02
$ hostname -f
Code:
ub1010ser02.satimis.com
$ mysql -h ub1010ser02 -u root -p
Code:
Enter password: 
ERROR 1130 (HY000): Host 'ub1010ser02.satimis.com' is not allowed to connect to this MySQL server
$ mysql -h ub1010ser02.satimis.com -u root -p
Code:
Enter password: 
ERROR 1130 (HY000): Host 'ub1010ser02.satimis.com' is not allowed to connect to this MySQL server
satimis

Last edited by satimis; 22nd April 2011 at 14:36.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cluster question versatile Installation/Configuration 4 31st March 2011 20:35
Networking: Routing / subnet question paulievox HOWTO-Related Questions 1 16th February 2010 00:45
Dumb Virtualhost Question DantePasquale Server Operation 1 16th December 2009 08:43
Hostname question, and DNS question andrewfashion General 1 20th April 2009 14:30
Question about LoabBalancer with Pound/Keepalived. 4nDr3s HOWTO-Related Questions 1 11th November 2007 14:55


All times are GMT +2. The time now is 22:09.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.