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 RPMType ‘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
spiranha – i think there’s a line missing from the tutorial… either that or it was assumed that we’d know what “edit” Means.
opensuse11:~ # vi config.inc.php
Although… i can get intot he file to edit it, but i can’t seem to save and close this file… am i missing something?
I am also a newbie to Linux/SUSE so please… be gentle!
@netwrkspider
I had the same error and after uninstalling and reinstalling apache2 all was fine. One of your packages must not have installed correctly.
tips for newbies (suse 11.x) (where I got stuck)
opensuse11:~ # yast2 –install php5 php5-mysql apache2-mod_php5 …
did not work for me. But did work using the softwaremanagement, selecting php5, php5-mysql, mysql mysql-tools and apache2-mod_php5 individualy (did the next step as well)
opensuse11:~ # mysqladmin -u root -p rootpassword
did not work for me (I lost some linux experiance) , but installed the mySQL Administrator package and changed the password from there.
opensuse11:~ # yast2 –install phpMyAdmin
did not work for me. because phpMyAdmin was not in the downloaded suse distribution. But downloaded it from the Suse site which installed perfectly, which upgraded dependency files in php5
LAMP works!
Nice tutorial!
Excelente! Just followed it using OpenSuse 11.2 and worked like a charm 🙂 Thanks!
available:
MySQL Administration Tool
MySQL Database Design Tool
MySQL Database Design Tool
root pass enter: admin tool – connect localhost/root
sorry:
MySQL Query Tool
My first problem was Toni’s problem, but after installation of apache modules appears a second one:
linux-az9s:/ # rcapache2 start
Starting httpd2 (prefork) Syntax error on line 14 of /etc/apache2/conf.d/mod_qos.conf:
Invalid command ‘QSC_WorkingDirectory’, 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
Any help;;
Just installed it on openSUSE 11.2. It all worked fine except the part of adding the password to mysql
opensuse11:~ # mysqladmin -u root -p rootpassword {didn’t work for me}
instead try which worked
opensuse11:~ # mysqladmin -u root password rootpassword
Great Tutorial! Thx Man!
Installing MySQL 5.0.67 on openSuSE 11.1 using “Yast2 –install mysql mysql-tools” (that’s always 2 hyphens before the spelled-out option; one hyphen before the abbreviated option: -i) didn’t turn out as described above.
* rcmysql status reported “dead” rather than “unused”
* setting root p/w failed because the socket /var/lib/mysql/mysql.sock doesn’t exit
* remysql start seemed to work, but the status test again was “dead, No groups to be reported (Check your GNRs)”
[side rant: HTML is awful in it’s handling of typography.]
Looking at the process list in SysMonitor, there’s no MySQL even though I ran rcmysql start. In Yast System Services, mysql is not running until I enable it: /etc/init.d/mysql start returned 0(success). However, SysMon doesn’t list mysql as a process, and rcmysql status still shows “dead” as a response.
Tis a puzzlement! Hints appreciated.
my mod_rewrite in opensuse 11.X any one can help
just amaging i have a lamp server running in 10min ty man 😀
why my open suSE 11.3, there is no phpMyAdmin??
it cannot be download at yast..the error is the package haven’t been found??
anybody can help me??please..
on my phpMyAdmin..there is run successful, but there have some error, which is ‘mcrypt’ cannot be load..why??
When I try to access http://localhost or http://127.0.0.1 to test if apache can serve pages I get the following:
Error 403
You don’t have permission to access the requested object. It is either read-protected or not readable by the server.
Please help!!
this doesn’t work anymore … some commands aren’t the same anymore and phpmyadmin isn’t in the yast2 repositories anymore. suse 11.4 x64 .
Perfect – except for one thing…
You need to enable PHP in the server modules through Yast2 -> Network Services -> HTTP Server -> Server modules
Thanks
hi,thanks you work.
when i try the last step,
yast2 –install phpMyAdmin
No such client module –install
The search path follows. It does not include the current directory.
/y2update/clients
/root/.yast2/clients
/usr/share/YaST2/clients
is phpMyAdmin needed download alone?thanks a lot
Hi friends, I have installed the Lampp in opensuse. it runs everything perfectly. That is the start. In any case xampp is running now.
Console tells me:
Starting XAMPP for Linux 1.5.5a …
XAMPP: Starting Apache with SSL (and PHP5) …
XAMPP: Starting MySQL …
XAMPP: Starting ProFTPD …
XAMPP for Linux started.
I get no error message, but when I viewed via a browser http://localhost or http://127.0.0.1 I get the page not found “can not display the webpage”. what is wrong?