Setup an Apache2 Web Server with Bionic

Moderator: Forum moderators

Post Reply
User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Setup an Apache2 Web Server with Bionic

Post by rockedge »

These are the rough steps of getting an Apache2 web server running in
Puppy Linux Bionic32 or Bionic64. These steps will work in every Puppy from Lucid 5.2.8 upwards.

load devx for Bionic
load 32 bit compat lib if Bionic64
in a terminal :

Code: Select all

adduser www-data -D
these are the packages installed with the PPM

apache2_2.4.29
apache2-bin_2.4.29
apache2-data_2.4.29
apache2-utils_2.4.29
libaprutil1-dbd-sqlite3_1.6.1-2
libaprutil1-ldap_1.6.1-2
mime-support_3.60ubuntu1

Configuration files for apache2 are here: /etc/apache2
The configuration files for the apache2 server need to be sym-linked or modified
to run correctly. As one becomes more familiar with the system there are many tweaks.



I find that it is easier to use ROX and open /etc/apache2 and symlink manually the .ini files from
/etc/apache2/mods-available to /etc/apache2/mods-enabled and then sym-link the .conf files
from /etc/apache2/conf-available to /etc/apache2/sites-available

open /etc/apache2/apache2.conf and find : ServerRoot "/etc/apache2"
below it add : ServerName localhost
or which ever specific domain name is appropriate.

These are some of the controls:

Code: Select all

apache2ctl start|stop|restart
Using apache2ctl is the most reliable way of start|stop|restart|status the apache2 web server running in Bionic32 or Bionic64.

There are more which can be referenced in the Apache documentation. Apache runs well in Puppy Linux but needs systemd for using the service commands as in Ubuntu. So without tracking down the differences to get those to work, using apache2ctl is the reliable way to go.

the web server root is /var/www/html
start the web server :

Code: Select all

 apache2ctl start
open a browser and open http//localhost/

Next step is installing the PHP.
User avatar
mohittomar13
Posts: 51
Joined: Wed Jul 29, 2020 5:12 pm
Location: New Delhi - INDIA
Has thanked: 17 times
Been thanked: 3 times

Re: Setup an Apache2 Web Server with Bionic

Post by mohittomar13 »

Thanks for the post. Please also upload the steps for PHP and mySQL. I think that this post should be closed for new replies and must serve as a guide/manual rather than a Q/A post (Normal Forum Thread). Or a new Section must be created on the Forum which serves as the central place for comman puppy HowTo. I hope you understand what I mean. You may also delete this post of mine and tag your post at the top in the new Section (If you create a new Section). Thanks :thumbup2: :thumbup:

Laptop: Dell 3568
CPU: intel i3 6006U
RAM: 12 Gigs
4GB-micron + 8GB-kingston

yeah, it works.. :D
HDD: 1TB
OS: Tripple boot- (Windows-10, Xubuntu-20.4LTs, Bionic Puppy) 64Bit

User avatar
mohittomar13
Posts: 51
Joined: Wed Jul 29, 2020 5:12 pm
Location: New Delhi - INDIA
Has thanked: 17 times
Been thanked: 3 times

Re: Setup an Apache2 Web Server with Bionic

Post by mohittomar13 »

I followed your instructions and tried to restart the server after adding the required lines in the apache2.cfg. After running the command to restart the server this is what I got.

Code: Select all

root@puppyPC5832:~# apache2ctl restart
AH00534: apache2: Configuration error: No MPM loaded.
Action 'restart' failed.
The Apache error log may have more information.

Laptop: Dell 3568
CPU: intel i3 6006U
RAM: 12 Gigs
4GB-micron + 8GB-kingston

yeah, it works.. :D
HDD: 1TB
OS: Tripple boot- (Windows-10, Xubuntu-20.4LTs, Bionic Puppy) 64Bit

User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by rockedge »

once we have a good set of instructions we can consider locking the topic but for now we will keep improving them here!

open /etc/apache2/mods-enabled and look for the sym-links /etc/apache2/mods-enabled/mpm_prefork.conf and /etc/apache2/mods-enabled/mpm_prefork.load that these 2 exist.

try in a terminal:

Code: Select all

a2enmod mpm_prefork
make sure there is only mpm_prefork. If there is a mpm_event.conf and / or mpm_event.load delete both.

There can only be one form of mpm enabled. There could be one of these three:
mpm_prefork (this is the one needed for php-cgi)
mpm_event
mpm_worker

more will be included on using php-fpm for multi-thread operation of PHP which will use one of the other mpm modules.

also possible to use in a terminal:

Code: Select all

a2dismod mpm_event
a2enmod mpm_prefork
apache2ctl restart
User avatar
mohittomar13
Posts: 51
Joined: Wed Jul 29, 2020 5:12 pm
Location: New Delhi - INDIA
Has thanked: 17 times
Been thanked: 3 times

Re: Setup an Apache2 Web Server with Bionic

Post by mohittomar13 »

Hi.. I found this link and XAMPP is working at 1000% speed

http://wikka.puppylinux.com/XAMPP

This serves my purpose.

For downloading the .sfs follow the link below.

https://code.google.com/archive/p/xampp-puppy/downloads :thumbup2: :thumbup: :thumbup:

Laptop: Dell 3568
CPU: intel i3 6006U
RAM: 12 Gigs
4GB-micron + 8GB-kingston

yeah, it works.. :D
HDD: 1TB
OS: Tripple boot- (Windows-10, Xubuntu-20.4LTs, Bionic Puppy) 64Bit

User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by rockedge »

Yes I used XAMPP a lot with Puppy Linux.

How To Build ZoneMinder 1.28.109 on an XAMPP stack
User avatar
CasparPup
Posts: 3
Joined: Sat Aug 22, 2020 11:11 am
Location: Holland
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by CasparPup »

mohittomar13 wrote: Thu Aug 13, 2020 8:12 pm

Hi.. I found this link and XAMPP is working at 1000% speed

http://wikka.puppylinux.com/XAMPP

This serves my purpose.

For downloading the .sfs follow the link below.

https://code.google.com/archive/p/xampp-puppy/downloads :thumbup2: :thumbup: :thumbup:

This is a package from 2013. From my point of view it's too old.

User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by rockedge »

Might be the best bet to install Apache2, mariaDB (mysql) and PHP7 directly. This will be more like a setup one would encounter commercially.

gabtech
Posts: 61
Joined: Sun Jul 19, 2020 12:29 pm
Been thanked: 1 time

Re: Setup an Apache2 Web Server with Bionic

Post by gabtech »

How do I enable apache to autostart at boot?

gabtech :thumbup2:

User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by rockedge »

you can do this by enabling the service. Method #1 is use the Puppy Setup and access the services and check the enable box. Usually is automatically done but double check it.

Method #2 on the command line (or something like this command)

Code: Select all

service apache2 enable
Screenshot(74).png
Screenshot(74).png (40.89 KiB) Viewed 2926 times
gabtech
Posts: 61
Joined: Sun Jul 19, 2020 12:29 pm
Been thanked: 1 time

Re: Setup an Apache2 Web Server with Bionic

Post by gabtech »

@rockedge

Thanks for the above solution.

Another problem here - I'm trying to configure maridb but I get the error msg in the screenshot attached below.

Attachments
maridb.png
maridb.png (59.19 KiB) Viewed 1986 times

gabtech :thumbup2:

User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by rockedge »

Have you initialized the mysql server and then ran /mysql_secure_installation?

The error indicates that either the directory /var/run/mysqld does not exist and/or the mysql server is not running (mysqld)

So try in a terminal

Code: Select all

mysqld &
or
mysqld -uroot &

and report what happens please.

gabtech
Posts: 61
Joined: Sun Jul 19, 2020 12:29 pm
Been thanked: 1 time

Re: Setup an Apache2 Web Server with Bionic

Post by gabtech »

This is the error I'm getting.

Attachments
msqld.jpg
msqld.jpg (128.96 KiB) Viewed 1973 times

gabtech :thumbup2:

User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by rockedge »

Syntax Error!
the command should be: (check the spelling)

Code: Select all

mysqld -u root &
or
mysqld -uroot &

If it complains about using the user "mysql", try to add one with:

Code: Select all

adduser mysql

if there is an error doing that we will need to do some extra steps.

So looking at the screenshot the last command was typed in wrong!

gabtech
Posts: 61
Joined: Sun Jul 19, 2020 12:29 pm
Been thanked: 1 time

Re: Setup an Apache2 Web Server with Bionic

Post by gabtech »

@rockedge

HI and thanks. Still getting errors.

Attachments
msqld2.jpg
msqld2.jpg (84.78 KiB) Viewed 1969 times

gabtech :thumbup2:

User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by rockedge »

did you initialize the mysql server?

Code: Select all

mysqld --initialize --user=root

Change the owner of /var/log/mysql so it matches the server user. But first do the above then set your root password for mysql

gabtech
Posts: 61
Joined: Sun Jul 19, 2020 12:29 pm
Been thanked: 1 time

Re: Setup an Apache2 Web Server with Bionic

Post by gabtech »

@rockedge

Thanks man for the help. I now need to install zoneminder, is the inform you outlined here - http://oldforum.puppylinux.com/puppy/vi ... p?t=101999 workable in fossa.

gabtech :thumbup2:

User avatar
rockedge
Site Admin
Posts: 5898
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2123 times
Been thanked: 2230 times
Contact:

Re: Setup an Apache2 Web Server with Bionic

Post by rockedge »

This script that will install ZM. Open it up and use the parts you need from the point you are now. Which I assume you have the web server and mysql server running with PHP 7.2+

Remove the fake "gz" from the filename and make executable to run it if you want to.

02-install-fossa-zm.sh.gz
(76.45 KiB) Downloaded 60 times
gabtech
Posts: 61
Joined: Sun Jul 19, 2020 12:29 pm
Been thanked: 1 time

Re: Setup an Apache2 Web Server with Bionic

Post by gabtech »

@rockedge

Thanks for script.

gabtech :thumbup2:

Post Reply

Return to “Network/Server”