Jump to content

Start MySql and/or apache at boot [solved]


Rapha
 Share

Recommended Posts

Open Mandriva Control Center, there should be a "Services" section that lists all the services. Click the option beside these two to have them start at boot.

 

None of them are listed in the services section. I looked at "Mandriva Control Center->System->Enable or Disable Services".

I installed Apache and MySQL manually, and not the mandriva cd version.

 

Thank you

Link to comment
Share on other sites

Ah, that'll be why the services don't exist normally then.

 

OK, you'll need to look for the services, so try this:

 

whereis httpd
whereis mysqld

 

this will then tell you where httpd and mysqld exist. I will assume the results from this show:

 

/usr/local/apache2/bin/httpd

/usr/local/mysql/bin/mysqld

 

these might be different for you, this is OK, I'm just using as an example, to show you what to do next. So, to run these, do:

 

/usr/local/apache2/bin/httpd &
/usr/local/mysql/bin/mysqld &

 

the & tells the service to run in the background, and therefore means you get your command prompt back to use normally. Alternatively, to add these commands to start when you boot the machine, edit /etc/rc.local and add these to the bottom of the file:

 

/usr/local/apache2/bin/httpd
/usr/local/mysql/bin/mysqld

 

note that I didn't put an & this time. You don't need it when you do it this way. Please note, my commands are examples, so change them where necessary. Post back if you have any further probs.

 

Alternatively, you're best bet is to use the packages that come with mandriva, then you get the traditional services as we mentioned before.

Link to comment
Share on other sites

Hi Rapha,

 

You could also "try" the following:

 

1. Open up a terminal, console, shell, or which ever name you'd like to call it. :)

2. Type in the following command without the #>:

#> sudo service httpd restart

3. Enter the "root" password when prompted.

4. You should see output similar to the following:

 

Shutting down httpd: [ OK ]

Starting httpd: [ OK ]

 

5. The important one is the "starting" section. If this works go to step 6 else step 7.

6. #> sudo chkconfig httpd on

--- End: Apache should now start on subsequent boot.

7. If step 5 failed then I don't think Apache was installed. Could you explain what steps you took to install it?

 

Similar steps to 3,4, and 6 are following for mysql. It just depends which mysql you installed. On my system I would substitute 'httpd' with 'mysqld-max'.

 

Hope this helps.

Link to comment
Share on other sites

2. Type in the following command without the #>:

#> sudo service httpd restart

3. Enter the "root" password when prompted.

4. You should see output similar to the following:

 

Shutting down httpd: [ OK ]

Starting httpd: [ OK ]

 

5. The important one is the "starting" section. If this works go to step 6 else step 7.

6. #> sudo chkconfig httpd on

 

These would normally work if rpm packages had been installed, but he said here:

 

None of them are listed in the services section. I looked at "Mandriva Control Center->System->Enable or Disable Services".

I installed Apache and MySQL manually, and not the mandriva cd version.

 

so, neither of those would work, as this is what tyme originally suggested using the GUI to get to the services, which is effectively the same as using the command line for enabling and starting them as well ;)

 

When compiled from source, the services don't appear normally, so you're only option is to add them to /etc/rc.local to get them to integrate correctly. Unless of course, that they do create init scripts, then you could move these to /etc/init.d and then do:

 

chkconfig add httpd/mysqld

 

where httpd/mysqld is the name of the initscript, and then the rest of the chkconfig and service commands would work as normal (I put them both, to save me typing the same line twice for the httpd service and mysqld service).

Link to comment
Share on other sites

chkconfig add httpd/mysqld

where httpd/mysqld is the name of the initscript, and then the rest of the chkconfig and service commands would work as normal (I put them both, to save me typing the same line twice for the httpd service and mysqld service).

14 - 97 = -83 characters saved. :cheeky:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...