Results 1 to 10 of 10

Thread: How is LAMP server started and configured?

  1. #1
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    800

    Default How is LAMP server started and configured?

    I installed LAMP server yesterday from the OpenSuse DVD packages, as I intend to host a web page which uses Apache, PHP and MySQL. However I cannot find how to start it up and how to set LAMP server to automatically start on system login.

    Also how do I configure it once I can start it? Do I need to edit some .cfg files again? Do Apache PHP and MySQL link together correctly by default? What is the path to the MySQL storage? Thanks.
    openSUSE Tumbleweed x64, KDE Framework 5

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How is LAMP server started and configured?

    You can start Apache and MySQL from YaST or from the CLI

    Code:
    chkconfig --set mysql on
    chkconfig --set apache2 on
    /etc/init.d/mysql start
    /etc/init.d/apache2 start
    Thereafter they will start at boot.

    You don't need to know where MySQL stores its files since you wouldn't access those files directly. But you need the PHP5 module php5-mysql installed to be able to communicate with the MySQL server. Each app would have its own database, login and password. The doco that came with the app would instruct you on how to set those up.

  3. #3
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: How is LAMP server started and configured?

    Last edited by swerdna; 14-Jan-2009 at 07:05.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  4. #4
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    800

    Default Re: How is LAMP server started and configured?

    Allright, I managed to get Apache working. All I had to do was go to YAST -> Network Services -> HTTP Server and configure everything there from a very comfortable and easy wizard. Now my web page can be accessed and entered.

    I still have a problem however: I don't know how to get PHP and MySQL working as well. How do I setup MySQL now so it connects with Apache and PHP and setup its databases, users, etc? Also I do need to know where MySQL keeps its storage cuz I sometimes have to work around there with these files manually.
    openSUSE Tumbleweed x64, KDE Framework 5

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How is LAMP server started and configured?

    No, you really don't need to touch MySQL's database files. What would you do with files like user.frm, user.MYD, user.MYI, etc? MySQL provides you with utilities to handle those. Unless you are doing a plain backup, and even then, a mysqldump is better, especially if the DB is constantly modified. Buf FYI, they are in /var/lib/mysql.

    As mentioned before, PHP connects to MySQL by calling functions from the php5-mysql connector and libmysql library, which you will get by loading the php5-mysql package. It's just a matter of programming. Each web app will have its ways of setting up the connection.

  6. #6
    Join Date
    Jan 2009
    Location
    Toronto, Ontario
    Posts
    188

    Default Re: How is LAMP server started and configured?

    Php can be installed using the software management tool in Yast. I installed it--along with the php-mysql and various other extensions by simply searching on the term php.

  7. #7
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    800

    Default Re: How is LAMP server started and configured?

    Quote Originally Posted by ken_yap View Post
    No, you really don't need to touch MySQL's database files. What would you do with files like user.frm, user.MYD, user.MYI, etc? MySQL provides you with utilities to handle those. Unless you are doing a plain backup, and even then, a mysqldump is better, especially if the DB is constantly modified. Buf FYI, they are in /var/lib/mysql.

    As mentioned before, PHP connects to MySQL by calling functions from the php5-mysql connector and libmysql library, which you will get by loading the php5-mysql package. It's just a matter of programming. Each web app will have its ways of setting up the connection.
    It's plain backups that I need to do, yes. I have experimented with dumps and other types of integrated MySQL backup systems and even lost a database basing myself on these, so plain backups are the only things I ever go with nowadays.

    Anyway, if on the installation of LAMP server MySQL and PHP are already linked, how do I make databases, create users and give each permissions over which database I wish and everything else I must do?

    Quote Originally Posted by yu210148 View Post
    Php can be installed using the software management tool in Yast. I installed it--along with the php-mysql and various other extensions by simply searching on the term php.
    I already have it installed with LAMP server, I just need to configure everything now.
    openSUSE Tumbleweed x64, KDE Framework 5

  8. #8
    Join Date
    Jan 2009
    Location
    Toronto, Ontario
    Posts
    188

    Default Re: How is LAMP server started and configured?

    Well, personally I use the mysql module in webmin to do that sort of thing but I know that's not for everyone. A popular tool for configuring databases, tables, users, etc. in mysql is a tool called phpmyadmin. Or if you're handy from the command line you can do that sort of thing with the mysql client. Just open a terminal and type mysql at the command line.

  9. #9
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    800

    Default Re: How is LAMP server started and configured?

    Quote Originally Posted by yu210148 View Post
    Just open a terminal and type mysql at the command line.
    Tried that as root but it gives me this error:

    Code:
    linux-wdzw:~ # mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    linux-wdzw:~ #
    Also, /var/lib/mysql appears to be a completely empty folder.
    openSUSE Tumbleweed x64, KDE Framework 5

  10. #10
    Join Date
    Jan 2009
    Location
    Toronto, Ontario
    Posts
    188

    Default Re: How is LAMP server started and configured?

    Humm, odd. What output do you get if (as root) you do:
    Code:
    /sbin/service mysql restart

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •