HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Questions and Problem when following Dapper Drake Perfect Setup (http://www.howtoforge.com/forums/showthread.php?t=18512)

FXT 17th December 2007 12:58

Questions and Problem when following Dapper Drake Perfect Setup
 
Hi there!

I've been following the perfect setup howto for ubuntu server 6.06 lts here to get a server with ispconfig and joomla running.

Edit: All this is happening in a VMWare VM on an XP host. I'm doing all this via putty from another XP box on the LAN.

I have a few questions:

(1)
I am running this server on my LAN, with the possibility of later making it accessible to the internet (via my router's DMZ or specific port forwarding). If I don't plan on using DynDNS or something comparable, how would i go about changing /etc/hosts?
Following the howto to the letter, I would get this:

Code:

127.0.0.1      localhost.localdomain localhost
192.168.1.222  servebox.example.com  servebox

# The following lines are desirable for IPv6 capable hosts
::1    ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

What purpose does the "servebox.example.com" have, is it even necessary? I don't plan on having this machine reachable via DNS, just IP.

According to the howto, both "hostname" and "hostname -f" should output "servebox.example.com". Is that really correct? "hostname" only outputs "servebox" for me.

(2)
I'm running into a problem after installing mysql according to the howto. It might very well be related to the question above. It all works according to plan until i set the root password with:

Code:

mysqladmin -u root password newpasswordhere
The next step

Code:

mysqladmin -h servebox.example.com -u root password newpasswordhere
gives the following error:

Code:

mysqladmin: connect to server at 'servebox.example.com' failed
error: 'Host 'servebox.example.com' is not allowed to connect to this MySQL server'

I'd like to proceed with the install, but i'm stuck here.

Any help is appreciated.

(3) Just thought of another question. Why do we want mysqld to listen on other interfaces than localhost? Anything that accesses the DB should be on the machine, anyway.

falko 18th December 2007 17:51

Quote:

Originally Posted by FXT
What purpose does the "servebox.example.com" have, is it even necessary? I don't plan on having this machine reachable via DNS, just IP.

It's not necessary, but saves a DNS lookup if your system uses servebox.example.com somewhere.

Quote:

Originally Posted by FXT
According to the howto, both "hostname" and "hostname -f" should output "servebox.example.com". Is that really correct? "hostname" only outputs "servebox" for me.

Run
Code:

echo "servebox.example.com" > /etc/hostname
/etc/init.d/hostname.sh start

Now both hostname and hostname -f should show servebox.example.com.

Quote:

Originally Posted by FXT
(2)
I'm running into a problem after installing mysql according to the howto. It might very well be related to the question above. It all works according to plan until i set the root password with:

Code:

mysqladmin -u root password newpasswordhere
The next step

Code:

mysqladmin -h servebox.example.com -u root password newpasswordhere
gives the following error:

Code:

mysqladmin: connect to server at 'servebox.example.com' failed
error: 'Host 'servebox.example.com' is not allowed to connect to this MySQL server'

I'd like to proceed with the install, but i'm stuck here.

Any help is appreciated.

Follow the steps in chapter 8 on http://www.howtoforge.com/perfect_se...pensuse10.3_p4 , beginning with As you've seen in the netstat output, MySQL is not only listening on localhost to fix the hostname in the MySQL database.

Quote:

Originally Posted by FXT
(3) Just thought of another question. Why do we want mysqld to listen on other interfaces than localhost? Anything that accesses the DB should be on the machine, anyway.

If all applications that need the database are on the same host, then MySQL doesn't need to listen on all interfaces.

FXT 6th January 2008 00:38

Thank you for your answer, Falko. I couldn't check up on this over Christmas, thus the late reply.

hosts file question:

Quote:

Originally Posted by falko
It's not necessary, but saves a DNS lookup if your system uses servebox.example.com somewhere.

So If my server will not have a domain name, but just a non-routable LAN address, I should basically leave /etc/hosts alone (which i'm guessing is preferable)?
Or is it necessary to just change the file contents from the perfect setup like so:

Code:

127.0.0.1      localhost.localdomain localhost
192.168.1.222  servebox

# The following lines are desirable for IPv6 capable hosts
::1    ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

This is an important clarification for me, whether to change anything in that file and if so, what exactly. As of the time of this post, I have restarted the perfect setup and not modified /etc/hosts/ at all.

Quote:

Originally Posted by falko
Run
Code:

echo "servebox.example.com" > /etc/hostname
/etc/init.d/hostname.sh start

Now both hostname and hostname -f should show servebox.example.com.

Assuming I do not have to change /etc/hosts, the hostname command should output only "servebox", correct?

MySQL Problem:

Quote:

Originally Posted by falko
Follow the steps in chapter 8 on http://www.howtoforge.com/perfect_se...pensuse10.3_p4 , beginning with As you've seen in the netstat output, MySQL is not only listening on localhost to fix the hostname in the MySQL database.

Quote:

Originally Posted by falko
If all applications that need the database are on the same host, then MySQL doesn't need to listen on all interfaces.

I have not modified /etc/mysql/my.cnf as per the perfect setup howto, because i only want mysql to listen on localhost. Given that change from the setup, is the command

Code:

mysqladmin -h server1.example.com -u root password yourrootsqlpassword
even necessary? In my case, the correct syntax would be:

Code:

mysqladmin -h servebox -u root password yourrootsqlpassword
?

My user DB looks like this:

Code:

+-----------+------------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| Host      | User            | Password        | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections |
+-----------+------------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| localhost | root            | 4db6dbb76d899aa6 | Y          | Y          | Y          | Y          | Y          | Y        | Y          | Y            | Y            | Y        | Y          | Y              | Y          | Y          | Y            | Y          | Y                    | Y                | Y            | Y              | Y                | Y                | Y              | Y                  | Y                  | Y                |          |            |            |              |            0 |          0 |              0 |                    0 |
| servebox  | root            |                  | Y          | Y          | Y          | Y          | Y          | Y        | Y          | Y            | Y            | Y        | Y          | Y              | Y          | Y          | Y            | Y          | Y                    | Y                | Y            | Y              | Y                | Y                | Y              | Y                  | Y                  | Y                |          |            |            |              |            0 |          0 |              0 |                    0 |
| localhost | debian-sys-maint | 0167e3a23156214d | Y          | Y          | Y          | Y          | Y          | Y        | Y          | Y            | Y            | Y        | Y          | Y              | Y          | Y          | Y            | Y          | Y                    | Y                | Y            | Y              | Y                | N                | N              | N                  | N                  | N                |          |            |            |              |            0 |          0 |              0 |                    0 |
+-----------+------------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+

Does that make sense?

I'd like to continue the perfect setup now, and was wondering whether i should hold off until this mysql thing is solved or whether i can just go on installing. Is this something that can be fixed later? I know mySQL should be up and running by the time i install ISPConfig, at the latest.

Sorry for the long post, but this is mostly new to me, and i need help getting to grips with it.

volksman 6th January 2008 02:06

Quote:

Originally Posted by FXT
So If my server will not have a domain name, but just a non-routable LAN address, I should basically leave /etc/hosts alone (which i'm guessing is preferable)?
Or is it necessary to just change the file contents from the perfect setup like so:

Code:

127.0.0.1      localhost.localdomain localhost
192.168.1.222  servebox

# The following lines are desirable for IPv6 capable hosts
::1    ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

This is an important clarification for me, whether to change anything in that file and if so, what exactly. As of the time of this post, I have restarted the perfect setup and not modified /etc/hosts/ at all.

I'm pretty sure if you are using IP only then no modifications are needed to /etc/hosts. However either way it is really a moot point because as Falko said all this does is save or fake a DNS look up. This will not make or break your setup.

Quote:

Originally Posted by FXT
MySQL Problem:

I have not modified /etc/mysql/my.cnf as per the perfect setup howto, because i only want mysql to listen on localhost. Given that change from the setup, is the command

Code:

mysqladmin -h server1.example.com -u root password yourrootsqlpassword
even necessary? In my case, the correct syntax would be:

Code:

mysqladmin -h servebox -u root password yourrootsqlpassword
?

My user DB looks like this:

Code:

+-----------+------------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| Host      | User            | Password        | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections |
+-----------+------------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| localhost | root            | 4db6dbb76d899aa6 | Y          | Y          | Y          | Y          | Y          | Y        | Y          | Y            | Y            | Y        | Y          | Y              | Y          | Y          | Y            | Y          | Y                    | Y                | Y            | Y              | Y                | Y                | Y              | Y                  | Y                  | Y                |          |            |            |              |            0 |          0 |              0 |                    0 |
| servebox  | root            |                  | Y          | Y          | Y          | Y          | Y          | Y        | Y          | Y            | Y            | Y        | Y          | Y              | Y          | Y          | Y            | Y          | Y                    | Y                | Y            | Y              | Y                | Y                | Y              | Y                  | Y                  | Y                |          |            |            |              |            0 |          0 |              0 |                    0 |
| localhost | debian-sys-maint | 0167e3a23156214d | Y          | Y          | Y          | Y          | Y          | Y        | Y          | Y            | Y            | Y        | Y          | Y              | Y          | Y          | Y            | Y          | Y                    | Y                | Y            | Y              | Y                | N                | N              | N                  | N                  | N                |          |            |            |              |            0 |          0 |              0 |                    0 |
+-----------+------------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+

Does that make sense?

I'd like to continue the perfect setup now, and was wondering whether i should hold off until this mysql thing is solved or whether i can just go on installing. Is this something that can be fixed later? I know mySQL should be up and running by the time i install ISPConfig, at the latest.

Sorry for the long post, but this is mostly new to me, and i need help getting to grips with it.

Unless I'm missing something with ISPConfig I think this is again a moot point. If you are running everything on one server and never allowing remote mySQL connections then yeah localhost is fine and your connect string can be as simple as:

Code:

mysql -u root -p
However ISPConfig may use a host in its connect string, this can likely be easily modified to localhost.

I've only used ISPConfig briefly once before. It seems like a bit of overkill for an IP based setup like yours. You sure you need it?

FXT 6th January 2008 14:36

Thank you for your reply, volksman!

Quote:

Originally Posted by volksman
I'm pretty sure if you are using IP only then no modifications are needed to /etc/hosts. However either way it is really a moot point because as Falko said all this does is save or fake a DNS look up. This will not make or break your setup.

OK, so after some deliberation I've decided to leave /etc/hosts alone for good. If it has the same functionality as in Windows, leaving it alone will be the best thing. Thank you for the input.


Quote:

Originally Posted by volksman
Unless I'm missing something with ISPConfig I think this is again a moot point. If you are running everything on one server and never allowing remote mySQL connections then yeah localhost is fine and your connect string can be as simple as:

Code:

mysql -u root -p
However ISPConfig may use a host in its connect string, this can likely be easily modified to localhost.

So going from your explanation, the problem I was inquiring about isn't really a problem in my setup, where MySQL is localhost only.
I have just ignored MySQL after its installation for now, and will tackle it again should it become necessary.
When I get to the setup of ISPConfig, I'll most likely have to ask again.

Quote:

Originally Posted by volksman
I've only used ISPConfig briefly once before. It seems like a bit of overkill for an IP based setup like yours. You sure you need it?

I decided after talking with someone who will be using this machine with me, to make it publicly accessible. I'll forward the necessary ports for its operation to the VM's fixed LAN IP. So it will not be strictly IP based. I have a "abcd.dyndns.org" domain and plan on using it for this machine.

I want to have a tool that will allow me to take care of administrative stuff from a nice interface, with no chance of mistyping in config files, and no need for excessive command line interaction. Web based administration just sounds nice and convenient.


I do have new question, that came up when continuing:

I continued with the setup, and am currently going through the Postfix configuration. During that configuration, I have to specify "Mail Name". Now, i might be overthinking this, but do I have to specify "servebox.dyndns.org" (servebox being the machine name), or do I specify "abcd.dyndns.org". The example given in the howto would only apply, if the machine was directly reachable on a public IP and the domain was hosted on it? I'm leaning towards "abcd.dyndns.org", but I'd like to make sure.
For instance, how would I change this line:
Code:

Other destinations to accept mail for? (blank for none) <-- server1.example.com, localhost.example.com, localhost
for correct functionality?

falko 7th January 2008 15:10

Quote:

Originally Posted by FXT
I continued with the setup, and am currently going through the Postfix configuration. During that configuration, I have to specify "Mail Name". Now, i might be overthinking this, but do I have to specify "servebox.dyndns.org" (servebox being the machine name), or do I specify "abcd.dyndns.org". The example given in the howto would only apply, if the machine was directly reachable on a public IP and the domain was hosted on it? I'm leaning towards "abcd.dyndns.org", but I'd like to make sure.
For instance, how would I change this line:
Code:

Other destinations to accept mail for? (blank for none) <-- server1.example.com, localhost.example.com, localhost
for correct functionality?

It doesn't matter which hostname you use as long as its DNS record is pointing to your server's (public) IP address.

FXT 8th January 2008 11:57

Thanks for the answer, I'm progressing nicely with this setup now, albeit slowly...

When configuring MySQL before, I created a password for the user "root", and only "root". That is a MySQL-specific user, correct? As in, not the system's root user? Would it make sense to create new MySQL users for ISPConfig, a CMS, etc, all with their own credentials and databases?

volksman 8th January 2008 16:41

Personally I would. That way if someone gets in they don't get access to everything (depending on the privileges you grant to each additional user).

FXT 8th January 2008 23:27

Quote:

Originally Posted by volksman
Personally I would. That way if someone gets in they don't get access to everything (depending on the privileges you grant to each additional user).

OK, so I will create a specific user for ISPConfig. Does this syntax look right:

Code:

mysql -u root -p

create database db_ispconfig;

GRANT ALL PRIVILEGES ON db_ispconfig.* TO 'ispconfig_user'@'localhost'
IDENTIFIED BY 'ispconfig_user_password' WITH GRANT OPTION;

quit;


volksman 8th January 2008 23:55

Looks good to me! :)


All times are GMT +2. The time now is 23:17.

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