Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 13-05-2009, 09:53 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Install & Configure LAMP (Apache/MySQL/PHP) in openSUSE 11.0
Install & Configure LAMP (Apache/MySQL/PHP) in openSUSE 11.0

Posted by admin on July 15th, 2008


One of the many popular combinations in Linux is the LAMP setup. LAMP to expand is Linux Apache MySQL PHP. Most of the websites running on the internet these days or LAMP servers where Linux is your flavor opensource operating system (openSUSE for us :-))
Apache2 is the master webserver on the planet
MySQL is your favorite opensource database
PHP is the popular web programming language

The easiest way to get the LAMP server installed would be to install LAMP from the YaST GUI as follows:
1. Computers - YaST - Install Software - Set filter to “Patterns” then select and accept “Web and LAMP” under Server functions. But, this installs things we don’t need from LAMP perpesctive like DNS, Perl modules etc.

I prefer the manual option to setup a LAMP Server.
So without wasting much of time, lets proceed to get LAMP up and running on your openSUSE in no time. I’m using openSUSE 11.0 but the procedure should equally work on earlier 10.3 and other 10.2 versions.
Install & Configure Apache2 Webserver
Install Apache webserver
opensuse11:~ # yast2 –install apache2
This should install apache webserver. To check try the following command:
opensuse11:~ # rcapache2 status
Checking for httpd2: unused
That tells you, the Apache webserver is installed but just not started yet.
To test if the webserver serves pages, add a file index.html into /srv/www/htdocs/ directory. This is the default web root directory for apache on your system.
opensuse11:~ # cd /srv/www/htdocs
opensuse11:~ # vi index.html

and enter some text say “Welcome to openSUSE 11.0
Start Apache2 Webserver
Now start the Apache 2 webserver so we can check if it works OK.
opensuse11:~ # rcapache2 start
Starting httpd2 (prefork) done
Now, open a web browser like Firefox and go to http://localhost and you should see the ext you entered (here “Welcome to openSUSE 11.0″)
Let’s proceed to install PHP5
Install PHP5
opensuse11:~ # yast2 –install php5 php5-mysql apache2-mod_php5
This should install PHP5, PHP5-MySQL module and the Apache2 PHP5 module.
For Apache2 to enable the PHP5 module, restart for changes to take effect.
opensuse11:~ # rcapache2 restart
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) done
Install & configure MySQL
opensuse11:~ # yast2 –install mysql mysql-tools
This should install MySQL Database Server and options mysql-tools (for administration) on your openSUSE. To check the installation, run the following command:
opensuse11:~ # rcmysql status
Checking for service MySQL: unused
The above indicates that the MySQL Server is installed but not started yet.
Start MySQL Server
opensuse11:~ # rcmysql start
Starting service MySQL done
By default there is no root password set for MySQL and it is important to set the password for the ROOT account.
Set Root Password
opensuse11:~ # mysqladmin -u root -p rootpassword

This should set the root password as “rootpassword”. Set the password to something more appropriate.
To check if Root password is set and the MySQL Client can logon to the MySQL Server try the following:
opensuse11:~ # mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51a SUSE MySQL RPM
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| test |
+——————–+
3 rows in set (0.04 sec)
mysql>
In the above, I used mysql client to logon as root, entered the password and list the databases. That completes the installation of LAMP on openSUSE 11.0
To administer MySQL database, the easiest and the popular tool is phpMyAdmin, given that we have discussed PHP5, apache2 setup here which are required for phpMyAdmin, it makes sense to look at quickly setting up and configure phpMyAdmin
Install phpMyAdmin
opensuse11:~ # yast2 –install phpMyAdmin
This installs phpMyAdmin and setup a website at /srv/www/htdocs/phpMyAdmin directory. Change directory and use the sample config file to quickly setup phpMyAdmin.
opensuse11:~ # cd /srv/www/htdocs/phpMyAdmin
opensuse11:~ # cp config.sample.inc.php config.inc.php

Edit the file and look for

$cfg['blowfish_secret'] = ‘mysqladmin’;

Enter a value for blowfish secret (I’ve set it to mysqladmin here)
Thats done and has the default configs on it. Logon to phpMyAdmin from http://localhost/phpMyAdmin with the MySQL root username and password.
For advanced documentation, click here


Related posts


This entry was posted on Tuesday, July 15th, 2008 at 2:59 pm and is filed under Internet & Browser, WebServer. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

39 Responses to “Install & Configure LAMP (Apache/MySQL/PHP) in openSUSE 11.0”

  1. Anselmo Perroni Says:
    July 16th, 2008 at 8:25 pm Perfect…
  2. joseph Says:
    July 23rd, 2008 at 7:09 pm nice……
  3. Uwe Haenssler Says:
    July 30th, 2008 at 5:41 am Well done, exactly what the doctor ordered
  4. Luke Says:
    August 2nd, 2008 at 9:28 pm can’t install mysql-tools
  5. admin Says:
    August 3rd, 2008 at 2:02 am any details? errors?
  6. Luke Says:
    August 4th, 2008 at 10:00 pm Tryed yast2 –install mysql-tools
    but it can’t find it
  7. admin Says:
    August 4th, 2008 at 10:54 pm There is a formatting issue on this website “–” reads as one single”-”
    Try this
    yast2 –i mysql-tools
  8. Luke Says:
    August 5th, 2008 at 12:26 am I keep on getting this
    Following packages haven’t been found on the medium:
    mysql-tools
  9. index.php wont load openSuse cd version - openSUSE Forums Says:
    August 30th, 2008 at 8:11 am [...] maybe….? This is the setup of the webserver i did and works fine on DVD installed pc’s: Install & Configure LAMP (Apache/MySQL/PHP) in openSUSE 11.0 | SUSE & openSUSE please [...]
  10. Alcyon Says:
    September 26th, 2008 at 11:08 pm Here’s another thank you - I kept running into this problem with phpMyAdmin after installing - didn’t know what the problem was. Creating the config.inc.php as suggested here finally makes it work!
  11. Edward Says:
    October 1st, 2008 at 3:04 pm Very helpful post. Used YAST2 LAMP pattern directly rather than install. Otherwise only phpMyAdmin is not on Suse 11.0 demo DVD. Therefore this administration looks like a personal favorite and is downloaded separately? Overall this was a real assist for novice users.
  12. yltang Says:
    October 3rd, 2008 at 2:57 am Thanks for the post. I have followed every step suggested for installation, and every systems, Apache2, MySQL, and PHP, seemed to work just fine. However, my PHP code has problem connecting to MySQL using mysql_connect() function. There were no error message even if I turn the “display_error” ON in the php.ini file. Can anybody suggest some directions I may follow, or something I have to check to solve the problem. Thanks.
  13. Werner J Says:
    October 3rd, 2008 at 2:35 pm All but the root password sets correctly for me.
    I do the line and it gives me a new line with ‘Enter password:’ on it.
    It just stops dead there though I can get into everything since it has
    no password defined. Might add that this worked flawlessy on ubuntu with
    a bit of editing of apache2.conf and php.ini but neither here in OpenSuSE 11
    has been mentioned. I look into php.ini but couldn’t find the line with
    extension = mysql.so
    to uncomment to make sure it connects to it and neither did I find
    apache2.conf to add Include phpadmin/apache.conf
    It’s on a server that’s runs locally but still nice to have it working
    properly
  14. tonio32 Says:
    October 8th, 2008 at 9:45 am ho seguito la guida ma quando arrivo ad attivare apache con il comando rcapache2 start mi da questo errore :
    Starting httpd2 (prefork) (98)Address already in use: make_sock: could not bind to address [::]:80
    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    startproc: exit status of parent of /usr/sbin/httpd2-prefork: 1
  15. Chris Says:
    October 17th, 2008 at 1:02 am Same problem as Werner with the setting of the root password using
    mysqladmin -u root -p password
    I can’t set the password:
    Enter password:
    mysqladmin: connect to server at ‘localhost’ failed
    error: ‘Access denied for user ‘root’@'localhost’ (using password: YES)’
    How can I work around this?
  16. L. Says:
    October 23rd, 2008 at 5:29 pm I was also getting the root password setting problem.
    I have a MySQL book by Paul DuBois for MySQL4, and I tried typing in
    mysqladmin -h localhost -u root password "rootpass"
    and it worked.
    Give it a try.
  17. sidi Says:
    November 5th, 2008 at 8:01 am cool
  18. Pedro Says:
    November 5th, 2008 at 5:09 pm Funciono a la perfeccion. Gracias
    It did work perfectly. Thank you very much.
  19. Gary Diamant Says:
    November 12th, 2008 at 1:38 pm Hi! Thank you very much! It it the best ‘HowTo install LAMP’ I’ve seen so far!
  20. tjamieson Says:
    November 17th, 2008 at 5:25 am To correctly set the MySQL password enter the command:
    set password = password(”yournewpassword”);
    Enter this command at the mysql> prompt.
  21. syn Says:
    November 17th, 2008 at 11:23 pm thx .. merci super vraiment bien
    nice thank
  22. Buya Says:
    November 19th, 2008 at 5:45 pm Thank you very much this was very helpful the most helpful I have run into
    GodBless you and the OpenSource community
  23. NB Says:
    November 22nd, 2008 at 11:19 am Perfect one. Thankyou very much.
  24. stefan Says:
    November 29th, 2008 at 6:40 pm Hi there.
    whenever I tried to install either mysqhl or php I get the following message:
    - Cannot determine type for repository factory-non-oss.
    and later on it says it can’t find the mysql mysql-tools or certain php-tools, which means it doesn’t install mysql at all, I’m not sure about php.
    Also, when I open the web browser, going to http://localhost/ it would say access denied also I tried to change the rights with chmod… Because of that I also can’t add any files - only as root, but I was too frustrated to lear how vi works.
    Thanks in advance
  25. Asteway Says:
    December 17th, 2008 at 8:49 am While installing mysql I typed my password wrong and I couldn’t crack it. I have done this before, so can you send me the code to crack?
  26. Toni Says:
    December 26th, 2008 at 6:09 am i ‘ve installed apache2 server, but i get the following error when trying to run

    linux-fk7c:/srv/www/htdocs # rcapache2 start
    code>
    Module “include” is not installed, ignoring.
    Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
    Module “log_config” is not installed, ignoring.
    Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
    Starting httpd2 (prefork) Syntax error on line 11 of /etc/apache2/mod_log_config.conf:
    Invalid command ‘LogFormat’, perhaps misspelled or defined by a module not included in the server configuration
    The command line was:
    /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
    [/code]
    Did i forget to install something?
    when i check for status i get:
    Mã:
     linux-fk7c:/srv/www/htdocs # rcapache2 status
    Checking for httpd2:                                                 unused
    [/code]
  27. admin Says:
    December 26th, 2008 at 6:25 am @Toni: You are missing the mod_include, mod_log_config apache modules. Installing that should fix the problem.
  28. Dario Says:
    February 23rd, 2009 at 3:39 am Hi guys,
    I tried to follow the guide to install LAMP on SLES10 but I’ve some problems.
    I can’t install the mysql-tools and the phpMyAdmin.
    I tried so:
    yast2 -i mysql-tools / the error is that the following package haven’t found on the medium.
    yast2 -i phpMyAdmin / Same error like above
    Thank you all!
  29. Moh'd Says:
    March 1st, 2009 at 4:04 am Use XAMPP, much more easier to install and use.
  30. Dario Says:
    March 2nd, 2009 at 10:56 am No thanks, I prefer to use LAMP
    However I found a solution
    Thx all
    Bye,
  31. edwards Says:
    March 10th, 2009 at 8:47 pm Thanks for the tutorial. I’ll try it
  32. alisa Says:
    March 18th, 2009 at 12:01 pm I*ve installed apache2 and php5 but when e try rcmysql status after i*ve used yast2 -i mysql-tools
    in screen appears rcmysql not found please can you help me because i realy need to install mysql
  33. surya padhy Says:
    March 22nd, 2009 at 5:25 am I followed the exact steps as mentioned. The three packages - mysql-tools and apache2-mod-php5 and phpMyAdmin are not found on the DVD. so I downloaded the two apache2-mod-php5 and phpMyAdmin.
    I can see the index.html on local host,phpMyAdmin is fine and mysql is also fine. Everything is ok till now.
    But when added some php code in the index.html I am not getting those displayed in the output. Following is the index.html content
    testing
    Could you please help me admin ? Do i need to do some extra configuration for php?
  34. surya padhy Says:
    March 22nd, 2009 at 5:28 am A small correction for above post. I tried to provide the html code but it seems it will not work here. So just for information I used the ?” for php code.
  35. Sandeep Dhindle Says:
    March 26th, 2009 at 12:42 am Thanks a lot.
    Very straight forward.
    Best of its kind.
  36. xpd Says:
    April 9th, 2009 at 6:51 pm newbie here:
    i get this error.
    administrator@zion:~> yast2 -install apache2
    bash: yast2: command not found
  37. admin Says:
    April 9th, 2009 at 11:55 pm @xpd: Use “yast2 –install apache2″ (note two “-” before install)
    or
    use “yast2 -i apache2″
  38. Goobeguru Says:
    April 14th, 2009 at 1:07 am Hi, I get an error message “Media is not accessible”. Does it mean that apache2 is not a part of my SuseLinux 11.0 installation? Where do I find Apache2 download for this SuseLinux version?
  39. rEdLiNe Says:
    April 19th, 2009 at 11:43 pm mysqladmin: connect to server at ‘localhost’ failed
    error: ‘Access denied for user ‘root’@'localhost’ (using password: YES)’
Leave a Reply
  Trả lời ngay kèm theo trích dẫn này
Gửi trả lời


Công Cụ
Xếp Bài

Quyền Hạn Của Bạn
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 Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 03:51 AM. Giờ GMT +7



Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.