Installing a Basic LAMP Stack on CentOS 7
-
Installing a LAMP stack on CentOS is very simple and can be done during the installation procedure but assuming that you are working from a "minimal" install
yum install mariadb-server mariadb httpd php php-mysql firewalld systemctl enable httpd systemctl enable mariadb systemctl enable firewalld systemctl start mariadb mysql_secure_installation firewall-cmd --zone=public --add-port 80/tcp --permanent firewall-cmd --zone=public --add-port 443/tcp --permanent firewall-cmd --reload reboot
That's it. We installed Apache and got it set up, installed MariaDB and secured it, install PHP and the needed libraries and opened the firewall for the two key Apache (HTTPD) ports of 80 and 443. Go ahead and navigate to the IP address (or DNA A record URL) of your server and you should see the Apache test screen.
-
@scottalanmiller Wanted to give CentOS 7 a try but for the life of me I can't it to connect to the internet. Installing using legacy network adapter also isn't helping. Trying to get it up and running on Hyper-V. Any idea why Hyper-V is giving me such a hard time? I can successfully ping all internal LAN device so the network is, I'm assuming, configured correctly.
-
@NashBrydges said in Installing a Basic LAMP Stack on CentOS 7:
@scottalanmiller Wanted to give CentOS 7 a try but for the life of me I can't it to connect to the internet. Installing using legacy network adapter also isn't helping. Trying to get it up and running on Hyper-V. Any idea why Hyper-V is giving me such a hard time? I can successfully ping all internal LAN device so the network is, I'm assuming, configured correctly.
Does nmtui give you any adapters to work with?
-
@scottalanmiller That was telling me the NetworkManager was not running so I enabled it. I've gone in and confirmed IP, gateway, DNS servers are all entered. I rebooted and still unable to update.
-
@NashBrydges said in Installing a Basic LAMP Stack on CentOS 7:
@scottalanmiller That was telling me the NetworkManager was not running so I enabled it. I've gone in and confirmed IP, gateway, DNS servers are all entered. I rebooted and still unable to update.
That should be enabled by default.
-
@NashBrydges said in Installing a Basic LAMP Stack on CentOS 7:
@scottalanmiller That was telling me the NetworkManager was not running so I enabled it. I've gone in and confirmed IP, gateway, DNS servers are all entered. I rebooted and still unable to update.
What does ip addr tell you?
-
-
Can you ping the gateway?
-
@scottalanmiller Interesting. I can ping the gateway from all other devices but not this VM.
-
@NashBrydges said in Installing a Basic LAMP Stack on CentOS 7:
@scottalanmiller Interesting. I can ping the gateway from all other devices but not this VM.
Sounds like it is most likely a Hyper-V or driver issue. Any other CentOS machines on Hyper-V?
-
@scottalanmiller None, this was my first try with setting up CentOS in hyper-v. I've tried reinstalling a number of times but nothing worked. Tried minimal install and even tried web server install from the DVD ISO but still nothing.
I'm going to try to reinstall but use the standard network adapter instead of the legacy one and see where that gets me. Suppose if that doesn't work I can setup XenServer on a spare R210II I've got sitting around.
-
You have or have not tried the non-legacy adapter yet?
-
@scottalanmiller I haven't yet. About to give it a try. Stuck to legacy since that was what I was reading everywhere.
-
@NashBrydges said in Installing a Basic LAMP Stack on CentOS 7:
@scottalanmiller I haven't yet. About to give it a try. Stuck to legacy since that was what I was reading everywhere.
Where is everywhere? Technet says to not use legacy.
Legacy is a fallback driver that you never want to use, it's low performance and high overhead. If you needed that for CentOS, it would make Hyper-V a silly, non-production ready platform. But Hyper-V is a good, solid performer.
-
Here are some general best practices for CentOS on Hyper-V:
-
@scottalanmiller Perhaps my google-fu wasn't as strong as I thought.
-
@NashBrydges said in Installing a Basic LAMP Stack on CentOS 7:
@scottalanmiller Perhaps my google-fu wasn't as strong as I thought.
LOL
-
@scottalanmiller Thanks for your help Scott. Looks like using the standard network adapter did the trick. Update is working.
-
Glad that that worked.
-
@scottalanmiller said in Installing a Basic LAMP Stack on CentOS 7:
@NashBrydges said in Installing a Basic LAMP Stack on CentOS 7:
@scottalanmiller I haven't yet. About to give it a try. Stuck to legacy since that was what I was reading everywhere.
Where is everywhere? Technet says to not use legacy.
Legacy is a fallback driver that you never want to use, it's low performance and high overhead. If you needed that for CentOS, it would make Hyper-V a silly, non-production ready platform. But Hyper-V is a good, solid performer.
Not only that, but I install all of my CentOS 7 VM's as Generation 2 when on Hyper-V they work perfectly with default settings for everything except secure boot. Uncheck secure boot. Everything else is 100% default settings.