What is the best apache stack to install on CentOs 6

Support for webhosts that use CentOS
Greenerpastures
Posts: 11
Joined: 2014/03/25 10:26:59

What is the best apache stack to install on CentOs 6

Postby Greenerpastures » 2014/03/25 23:20:42

Hi everyone,
I have just updated my vps to the latest CentOs 6 (2.6.32-431.5.1.el6.i686 ), with the help of TrevorH,
and I now plan to install an apache stack.
I would very much appreciate everyone's opinions on this matter.
I need apache, php, perl, and at some point a mail server, and of course a database, MySql would be my choice, because I know that e107cms and php-fusion run well on it.
But, I would like instead to try the maria fork of mysql, as it is supposed to be completable with the latest MySql server, as long as one does not activate any of the new features of maria.

What I really need to ask is, should I install something like xampp, or am I better off installing individual packages, I do not have much experience in this field, but I hope to pick things up as I go along, and would rather take the time to get it right, I am also concerned and would chose the option best suited to future upgrades, so any advise regards this aspect would help me chose the better options for the long term, I also want to keep things light and fast, unless phpmyadmin is a real hog on resources, but I assume an resources it uses will be released when its shut down again?.

Looking forward to any and all advise.

User avatar
Super Jamie
Posts: 308
Joined: 2014/01/10 23:44:51

Re: What is the best apache stack to install on CentOs 6

Postby Super Jamie » 2014/03/26 10:32:12

This walks you through setting it up with the packages in the repositories:
http://www.howtoforge.com/installing-li ... centos-6.0

This uses some third-party repos to get later versions of some things:
http://tecadmin.net/installing-apache-m ... os-redhat/

This details setting up LAMP with MariaDB:
http://www.unixmen.com/install-lamp-apa ... c-linux-6/

User avatar
TrevorH
Forum Moderator
Posts: 22590
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: What is the best apache stack to install on CentOs 6

Postby TrevorH » 2014/03/26 16:52:44

I would say that if you do not have much experience then you should stick with the CentOS supplied packages as they are regularly patched and easy to update. You can install them like so:

Code: Select all

yum install httpd php php-mysql mysql mysql-server


and to keep them up to date is as simple as running `yum update`. That's not a complete list of the packages you will need since different apps need different parts of php but you can see the entire list available by running `yum list php\*`.

You can find phpmyadmin packages in EPEL.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Greenerpastures
Posts: 11
Joined: 2014/03/25 10:26:59

Re: What is the best apache stack to install on CentOs 6

Postby Greenerpastures » 2014/03/26 21:02:42

Hi, and thank you for your answers.

I am going to play it safe and install via yum.
I will install apache, php and my sql, and update them as I install them.
I can install mariadb later, and use it alongside mysql for testing.

Two things I am not sure of,
#.1 I just don't know what the -y at the end of the command signifies? ( # yum install httpd -y )
maybe someone could tell me the reason for this.

#.2 Am I right in assuming that if I issue a yum install command such as yum install httpd ,
that yum will install a package that is relevant to the version of CentOs am running, or does one
have to configure yum to search for the correct version in some way.

Thank you for your patience and answers.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: What is the best apache stack to install on CentOs 6

Postby gerald_clark » 2014/03/26 21:27:27

You will find the answers to those questions when you read
https://www.centos.org/modules/newbb/vi ... p?forum=54

Greenerpastures
Posts: 11
Joined: 2014/03/25 10:26:59

What is the best apache stack to install on CentOs 6

Postby Greenerpastures » 2014/03/26 22:21:34

Ok, I installed apache using yum install httpd -y, and got an ok when the process finished.
I then started apache, and got an ok.

I have no idea how to open the apache test page to see if things are ok, as I have not yet changed my details to point from
my old web host to my vps, nor do I know how to go about this.

But I can see there is a facility on my previous hosting account, where by I can log in and manage my domain,
this gives me the ability to change my dns to point to the appropriate IP, which I don't even know, would it do to point to the
main IP of my vps account?, maybe someone will comment.

Either way, I want to update httpd, and I need to know if I have to include the -y at the end like I did when I installed httpd.
I also can not find the file in the instructions am using to configure IP tables, it says to go to vi /etc/sysconfig/iptables,
and when I open this file here is what i see, perhaps someone could let me know if it is this file i need to edit,
as am trying to add the following so I can access the server:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

the only file I can find in etc/sysconfig/ is iptables-config

Any advise in any of these matters would be very helpful.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: What is the best apache stack to install on CentOs 6

Postby gerald_clark » 2014/03/26 22:30:38

I recommend you NEVER use the -y option.
Just point your web browser to the IP of your server, and read the instructions on the page.

Greenerpastures
Posts: 11
Joined: 2014/03/25 10:26:59

Re: What is the best apache stack to install on CentOs 6

Postby Greenerpastures » 2014/03/26 23:27:13

Thanks gerald_clark, Unfortunatley I did, not sure whether or not it is responsible for the errors am now getting, I installed apache, and am now stuck on the process of updating the iptables file, but am getting errors on line 9 when I hit save, I never actually touched line 9, but I also get the same errors on lines one or two, when I uncomment them, one of those two has a - before the A, the other does not, I don't know which definition is correct as am following an example that has the -A. I would also like to know is the norm to have to rename your iptables from iptables-conf to iptables, as I could not find an iptables file, I renamed one of the two I found where the iptables file was supposed to be.

Here is the iptables file in question, perhaps someone will know if it is correct or corrupt,

# I added the two lines below to see if this would allow access to the server on vps, they were uncommented
#-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT#
#A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
# Load additional iptables modules (nat helpers)
# Default: -none-
# Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which
# are loaded after the firewall rules are applied. Options for the helpers are
# stored in /etc/modprobe.conf
#I never touched the line below but it also causes the same error as the two at the top.
IPTABLES_MODULES=""

# Unload modules on restart and stop
# Value: yes|no, default: yes
# This option has to be 'yes' to get to a sane state for a firewall
# restart or stop. Only set to 'no' if there are problems unloading netfilter
# modules.
IPTABLES_MODULES_UNLOAD="yes"

# Save current firewall rules on stop.
# Value: yes|no, default: no
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets stopped
# (e.g. on system shutdown).
IPTABLES_SAVE_ON_STOP="no"

# Save current firewall rules on restart.
# Value: yes|no, default: no
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets
# restarted.
IPTABLES_SAVE_ON_RESTART="no"

# Save (and restore) rule and chain counter.
# Value: yes|no, default: no
# Save counters for rules and chains to /etc/sysconfig/iptables if
# 'service iptables save' is called or on stop or restart if SAVE_ON_STOP or
# SAVE_ON_RESTART is enabled.
IPTABLES_SAVE_COUNTER="no"

# Numeric status output
# Value: yes|no, default: yes
# Print IP addresses and port numbers in numeric format in the status output.
IPTABLES_STATUS_NUMERIC="yes"

# Verbose status output
# Value: yes|no, default: yes
# Print info about the number of packets and bytes plus the "input-" and
# "outputdevice" in the status output.
IPTABLES_STATUS_VERBOSE="no"

# Status output with numbered lines
# Value: yes|no, default: yes
# Print a counter/number for every rule in the status output.
IPTABLES_STATUS_LINENUMBERS="yes"

# Reload sysctl settings on start and restart
# Default: -none-
# Space separated list of sysctl items which are to be reloaded on start.
# List items will be matched by fgrep.
#IPTABLES_SYSCTL_LOAD_LIST=".nf_conntrack .bridge-nf"


Any help would be great, thanks

User avatar
TrevorH
Forum Moderator
Posts: 22590
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: What is the best apache stack to install on CentOs 6

Postby TrevorH » 2014/03/26 23:55:47

That looks like /etc/sysconfig/iptables-config not /etc/sysconfig/iptables. They are different files and have different content. Your iptables rules should go in /etc/sysconfig/iptables not in the -config file.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: What is the best apache stack to install on CentOs 6

Postby gerald_clark » 2014/03/27 01:51:59

If you are not iptables savvy, use system-config-firewall.