LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Some help with apache setup (https://www.linuxquestions.org/questions/linux-newbie-8/some-help-with-apache-setup-4175597307/)

sigint-ninja 01-12-2017 11:33 AM

Some help with apache setup
 
ok so i built a basic wordpress site and want to host it on my centos7 server...im following this guide:

http://www.tldp.org/LDP/LGNET/12/server.html

for apache setup...can somebody maybe suggest a good one?
maybe on this fine site...

i came across this:

"I found this to be really disorganized, so I ended up putting mostly everything under one directory (I left the binaries in /usr/sbin):" is this absolutely necessary? or do you guys just leave things in their default location?

also this:

"And then to preserve the original Redhat file locations:"

again,is this very necessary...sorry guys just trying to setup
using best practices as i dont know squat about apache

thanks

oh just lastly,

i have bought a domain,just the domain,no hosting...how would i point DNS servers to my server?

bathory 01-12-2017 11:57 AM

Hi,

The tutorial you're following is quite dated (1996).
You can use your favorite search engine to find a newer one, like this one that is specific for apache/wordpress on Centos 7

Regards

notKlaatu 01-12-2017 12:06 PM

Don't overthink LAMP. It's actually quite simple to set up. On Red Hat / CentOS:

Code:

yum groupinstall web-server
This downloads and installs Apache and a few must-have PHP and Perl modules.

That's the L,A, and P in "LAMP", so now install the "M" part (MySQL, or its sister MariaDB):

Code:

yum install mariadb
Now if you navigate to your server in a web browser, you should be greeted with a CentOS-branded "it works!" message.

Proceed to setup your Wordpress as detailed in the Wordpress documentation.



DNS setup is not done on your server at all.There are a few ways to do it, but usually it's done through whatever company you bought your domain from. Login to your account and locate their control panel for setting up your domain. You want to make an A Name record for your site. This should be the domain name you purchased, pointing to the IP address of your server.

For example:

Code:

example.com.    A    93.184.216.34
Often, the domain name is abbreviated as just the at-symbol:

Code:

@    A    93.184.216.34
But interfaces differ, so do what your domain sales site tells you to.

You probably want to also create a CNAME record for the www subdomain:

Code:

www.example.com.    CNAME    example.com

Wait a bit for that to propagate. Verify it with the `host` command (you can do this on your server or from any machine running Linux):

Code:

host example.com
example.com has address 93.184.216.34
example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946

Did the right IP address show up? If so, the whole world can now type in your domain name and reach your server.

It's Apache's job, of course, to listen for incoming visits, and to route those requests to the correct site. In other words, you need to set Apache up to listen for example.com (or whatever your domain name is) and send those requests to wordpress. I believe that is covered in the Wordpress documents. If not, come back here and give us an update and maybe we can point you in the right direction, or otherwise assist you with your httpd conf.

Habitual 01-12-2017 03:07 PM

https://wordpress.org/about/requirements/
https://codex.wordpress.org/Installing_WordPress
http://codex.wordpress.org/Hardening_WordPress

sigint-ninja 01-12-2017 03:22 PM

you guys are the best...seriously!!!

sigint-ninja 01-14-2017 03:12 PM

one thing i find a bit confusing is regarding the database...

it tells you to install mariaDB (and i would prefer to use MySql
but then talks about creating an sql database

is mariaDB and mysql the same thing?

Habitual 01-14-2017 03:23 PM

Quote:

Originally Posted by sigint-ninja (Post 5655019)
is mariaDB and mysql the same thing?

I treat them as the same.

sigint-ninja 01-14-2017 03:42 PM

during the tutorial/setup i should have done sudo systemctl enable mariadb.service

i accidentally did:
sudo systemctl enable mariadb

and a long softlink was created

will this have any negative impact on my installation/machine?

sigint-ninja 01-14-2017 04:14 PM

sorry guys lastly,

why does the tutorial restart apache this way
sudo service httpd restart

but earlier it was:
sudo systemctl httpd restart (or restart httpd...cant remember)

is there a difference?

ondoho 01-15-2017 03:15 AM

^ that's sysvinit vs systemd for you.
welcome to the present!

sigint-ninja 01-15-2017 05:57 AM

ok so i followed it to a tee...everything installed etc etc
did the suggested firewall rules
my user account and password is correct

but now when i go 10.0.0.x i dont get wordpress i get

Error establishing a database connection

i have checked the credentials,i actually wrote them down
i think selinux might be doing something as a pop up was saying something about httpd

any suggestions...also lets just say i wanted to redo my credentials for sql how would i do that?

thanks for all the help so far

Habitual 01-15-2017 06:07 AM

Quote:

Originally Posted by sigint-ninja (Post 5655240)
ok so i followed it to a tee...everything installed etc etc
did the suggested firewall rules
my user account and password is correct

but now when i go 10.0.0.x i dont get wordpress i get

Error establishing a database connection

Answer is in an earlier link I know you haven't read, thoroughly?
https://codex.wordpress.org/Installi...ase_and_a_User

sigint-ninja 01-15-2017 06:15 AM

do you have to restart any services after editing wp-config.php?

sigint-ninja 01-15-2017 06:25 AM

tried this:

If you've got SELinux enable and are not a SELinux expert, apply this command:

setsebool -P httpd_unified 1

didnt help

Habitual 01-15-2017 03:29 PM

Quote:

Originally Posted by sigint-ninja (Post 5655244)
do you have to restart any services after editing wp-config.php?

Read more. a simple edit is not enough.


All times are GMT -5. The time now is 04:10 PM.