Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Jul 15, 2014 12:54 pm 
Offline
Newbie

Joined: Tue Jul 15, 2014 12:48 pm
Posts: 4
I would like to do something simple, yet, after many attempts and trying many, many different configurations, I can't get apache to default to php. I would like to do something simple, which is to convert any URL file request that doesn't match to a ".php" default. So, for example,

"http://www.domain.com/index" would become "http://www.domain.com/index.php"

and

"https://www.domain.com/index?user=2" would become "https://www.domain.com/index.php?user=2"

I would simply like to add
"DefaultType application/x-httpd-php"

to the apache configuration to accomplish this.

However, I can't figure it out -- i have already tried adding it to
-- httpd.conf
-- the virtual hosts (in sites-available, including to the file named "default")
-- the apache2.conf file

I have tried various combinations of the above.

I am using the recommended install of lamp per the linode guide.

Thanks in advance.


Top
   
PostPosted: Tue Jul 15, 2014 3:41 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
ajw,
I'm assuming that you restarted apache after changing the vhost file and the apache2.conf file.

You can look at this link which offers two options:
http://stackoverflow.com/questions/7516 ... web-server

You can make the changes in the link above (probably just one or the other) in your vhost file or an .htaccess file in the site's root directory. Using .htaccess doesn't require a restart to apache, though you'll need AllowOverride All in your vhost file for .htaccess to override setting in your vhost.

MSJ


Top
   
PostPosted: Tue Jul 15, 2014 7:06 pm 
Offline
Newbie

Joined: Tue Jul 15, 2014 12:48 pm
Posts: 4
Thanks - that worked.

I can't figure out why apache is reading my htaccess file since all of the "AllowOverride" I can find are set to " AllowOverride None". This is in /etc/apache2/sites-available/default and /etc/apache2/sites-available/default-ssl. I didn't try to override anywhere else (for example, no entry in the vhost/directory file for the site).

There is probably another file or reference I am missing, but I can't find it (I checked "/etc/apache2/apache2.conf", "/etc/apache2/httpd.conf", "/etc/apache2/conf.d/security").

It works, so I'm going with this solution -- but, if you also happen to know where else to verify that the settings are ok (or at least that I know where they are) that would be appreciated.

Thanks.


Top
   
PostPosted: Tue Jul 15, 2014 8:07 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
ajw,
The /etc/apache2/sites-available/default file is for the default site on the VPS. It's not the default settings for your sites. You probably have a file in sites-available with the name of your domain in it (eg, /etc/apache2/sites-available/yourdomainnamehere.com). That is the file that probably has AllowOverride All in it.


MSJ


Top
   
PostPosted: Tue Jul 15, 2014 8:16 pm 
Offline
Newbie

Joined: Tue Jul 15, 2014 12:48 pm
Posts: 4
Thank you. Based on the Apache docs, the default (no pun intended) for Apache AllowOverride is "All", so I'm assuming that is the case here (with no AllowOverride entries in the sites-available file).

Thanks again.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group