Posted by : fspot Nov 19, 2011

Maybe it can do on other Linux distributions. But, we have try it on Fedora and it's works. LAMPP is acronym from Linux Apache MySQL PHP PHPMyAdmin. You can download LAMPP from ApacheFriends.org

After you download the archive, by default it will be saved in Downloads directory. Lets begin the installation. Type this command on terminal (as root) :

$ su root
Password : <-- insert your root password
# tar -xzvf Downloads/xampp-linux-x.y.z.tar.gz -C /opt

Just that, and installation is done... You can activate the service by typy this command (as root) :

# /opt/lampp/lampp start

if you want to only activate Apache, run this command :

# /opt/lampp/lampp startapache

if you want to only activate MySQL, run this command :

# /opt/lampp/lampp startmysql

If you want to open MySQL CLI to manage your database, run this command :

# /opt/lampp/bin/mysql

If you want to integrate lampp to be default command, create link to /bin directory :

# ln -s /opt/lampp/lampp /bin/lampp

and now if you want to start lampp just use this (removing /opt/lampp/ to activate service) :

# lampp start

same for mysql, if you want to integrate MySQL CLI as default command, run this command :

# ln -s /opt/lampp/bin/mysql /bin/mysql

and now you just need to type this command to open MySQL CLI :

# mysql

If you want to make lampp as service, un this command :

# ln -s /opt/lampp/lampp /etc/init.d/lampp

so you can run this command :

# service lampp start

and you can make it as startup service by run this command :

# chkconfig --levels 235 lampp on


UPDATE :

now, for make a service run on startup, fedora directly using systemctl and not using chkconfig again (even it will be redirected to systemctl if you use chkconfig). But the systemctl use different scheme. First, you must make a file named lampp.service and place it on /usr/lib/systemd/system. You can follow this command :

$ sudo gedit /usr/lib/systemd/system/lampp.service

NOTE : your user account must have administrator priviledge for using command above. If you want to use root user, you must use this following command :

$ su root
Password: <-- your root password
# gedit /usr/lib/systemd/system/lampp.service

and put this inside that file :

[Unit]
Description=XAMPP for Linux
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=notify
ExecStart=/opt/lampp/lampp start
ExecReload=/opt/lampp/lampp reload
ExecStop=/opt/lampp/lampp stop

[Install]
WantedBy=multi-user.target


And then, type this command as root :

# systemctl daemon-reload
# systemctl enable lampp.service

If you want to check if this startup will work or not, use this command :

# systemctl start lampp.service

And then check it :

# systemctl status lampp.service

If work, you will see some sentences you find while activating lampp on terminal. And then open your web browser and type localhost. If XAMPP homepage appear, your job successful. (^_^)v

{ 12 komentar... read them below or Comment }

  1. Are you serious?!?!?
    This is some of the worst advice I have ever seen.

    # As root:

    yum install -y httpd mysql mysql-server php phpmyadmin

    Now, everytime there is a security update to ANY of these packages you will get them with your system updates.

    to start/stop/restart these services

    # As root:

    service httpd (start|stop|restart|reload)
    service mysqld (start|stop|restart)

    If you wan't help setting up virtual hosts with apache so you can serve files from your home directory (easier editing if your user has permissions on the file, right!). I can even show you how to do this without disabling SELinux, since the default help on the internet seems to suggest turning off SELinux (DON'T DO IT!).

    I have read through the articles you have posted, and so far your suggestions are down right terrible. Fedora Linux users deserve better than this, and since you have "fedora" in your URL, chances are someone is going to be looking for help one day and will disappointingly stumble upon this. This is just wrong on SO MANY LEVELS. Use the yum package manager and the built in repositories. They are there for your safety, and also for your convenience.

    You are going out of your way to make this not only harder, but stupider.

    ReplyDelete
  2. Sorry, I know to that it will make many safety issue IF IT'S USED ON ONLINE SERVERS...
    I make this post only for Offline users who want to explore how to managing their website offline..
    LAMPP have ability same with web hosting...
    Now lets look at this :

    yum install -y httpd mysql mysql-server php phpmyadmin

    It just that simple??
    How about php-xml, php-gd, and php-mbstring??
    And how about any needed package to build a strong web server??
    ever u think about SSL??
    are you just want to TRY managing your website only with standard httpd and php??
    is some web hosting use ONLY that??
    and now lets look where you are...
    You live (maybe) at high speed internet connection, ready to download, install, remove, update, and upgrade anything whatever you want..
    But I swear many people out there is not like you...
    this site just want to help the people like that..
    I guarantee this site will never harm users..
    If I must tell you, I make this site not for my benefit..
    I just want to share what I ever do with Fedora..
    Fedora is amazing...
    And I make this site to help other people exploring what Fedora can do...
    (^_^)v

    ReplyDelete
  3. Hi fspot,

    I tried your method and its not working in my laptop. The lampp service is not auto starting after restart. I belive its because fedora 16 is using systemd and its overriding or skipping the init command defined by "chkconfig --level 2345 lampp on".

    I noticed a spelling error in your command "# chkconfig --levels 235 lampp on" after I checked the man chkconfig pages and it says "--level" not --levels.

    I'm running Fedora 16 32bit and Xampp 1.7.7

    FYI:

    # chkconfig --list

    Note: This output shows SysV services only and does not include native
    systemd services. SysV configuration data might be overridden by native
    systemd configuration.

    fcron 0:off 1:off 2:off 3:off 4:off 5:off 6:off
    fcron_watch_config 0:off 1:off 2:off 3:off 4:off 5:off 6:off
    iscsi 0:off 1:off 2:off 3:on 4:on 5:on 6:off
    iscsid 0:off 1:off 2:off 3:on 4:on 5:on 6:off
    jexec 0:on 1:on 2:on 3:on 4:on 5:on 6:on
    lampp 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    livesys 0:off 1:off 2:off 3:on 4:on 5:on 6:off
    livesys-late 0:off 1:off 2:off 3:on 4:on 5:on 6:off
    netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
    netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
    network 0:off 1:off 2:off 3:off 4:off 5:off 6:off
    sandbox 0:off 1:off 2:off 3:off 4:off 5:on 6:off
    wine 0:off 1:off 2:on 3:on 4:on 5:on 6:off

    please help me on the proper setup to run the lampp as auto start service.

    Thanks.
    Zap.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Hi fspot,

    i tried all the steps in your article and its not working for me!!! and while checking the man pages i noticed that your command "chkconfig --levels 235 lampp on" has a typo in the --levels, it should be --level

    Looks like Fedora 16 is using the newer systemd services for init sequence. so the older SysV services is being ignored... i guess thats why your commands are not working. Anyway, can you help me with the systemd commands to setup lampp as a startup service? what commands should i give to verfiy that i have executed all of the commands in your article, correctly?

    Regards,
    Zaq.

    ReplyDelete
    Replies
    1. Sorry its been loooooooooong time for this comment to be replied. I already update the scheme for making lampp can run on startup. I hope you that will help you and resolving your problem. (^_^)v

      Delete
  6. Hi, I'm trying to install xampp as a service with systemd on Manjaro.
    I have created the xampp.service file and enabled it.
    When I try to start the service I have something strange. This is my output of status command:

    [root@heinlein ~]# systemctl daemon-reload
    [root@heinlein ~]# systemctl enable lampp.service
    [root@heinlein ~]# systemctl start lampp.service
    [root@heinlein ~]# systemctl -l status lampp.service
    lampp.service - XAMPP for Linux
    Loaded: loaded (/usr/lib/systemd/system/lampp.service; enabled)
    Active: inactive (dead) since Thu 2014-01-30 12:22:58 CET; 28s ago
    Process: 4663 ExecStop=/opt/lampp/lampp stop (code=exited, status=0/SUCCESS)
    Process: 4207 ExecStart=/opt/lampp/lampp start (code=exited, status=0/SUCCESS)
    Main PID: 4207 (code=exited, status=0/SUCCESS)

    Jan 30 12:22:52 heinlein lampp[4207]: XAMPP: Starting ProFTPD...
    Jan 30 12:22:52 heinlein proftpd[4653]: heinlein - ProFTPD 1.3.4a (maint) (built Mon Jun 4 2012 15:34:36 CEST) standalone mode STARTUP
    Jan 30 12:22:52 heinlein lampp[4207]: XAMPP for Linux started.
    Jan 30 12:22:52 heinlein lampp[4663]: Stopping XAMPP for Linux 1.8.1...
    Jan 30 12:22:52 heinlein lampp[4663]: XAMPP: Stopping Apache with SSL...
    Jan 30 12:22:56 heinlein lampp[4663]: XAMPP: Stopping MySQL...
    Jan 30 12:22:58 heinlein lampp[4663]: XAMPP: Stopping ProFTPD...
    Jan 30 12:22:58 heinlein lampp[4663]: XAMPP stopped.
    Jan 30 12:22:58 heinlein proftpd[4653]: heinlein - ProFTPD killed (signal 15)
    Jan 30 12:22:58 heinlein systemd[1]: Started XAMPP for Linux.

    Seems that XAMPP starts and immediately stops all.

    Any tips?
    Thanks in advance

    ReplyDelete
    Replies
    1. Maybe I have solved. The correct type in the file is forking and not notify.
      Now it works very fine :)

      Bye
      Ktrl+S

      Delete
  7. Best web hosting companies. Reviews, rates, statistics of top hosting companies.
    Find best hosting company at www.HostingCompaniesz.com

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Hi
    Im using fedora server 23 with XAMPP PHP 7.0.5 installed and i want to upgrade PHP 7.0.6.
    How do you advise me to do?
    php settings lose? risk sites not to work?

    ReplyDelete