Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having trouble getting the sub pages of a CMS working on a Centos virtual machine. In a web browser, if I go to localhost I see “Apache 2 Test Page powered by CentOS”. If I go to localhost/index.php then I see my joomla's website home page. If I click on a menu like localhost/contact then I get what looks like an apache page not found. It says

“Not Found The requested URL /contact was not found on this server. Apache/2.2.15 (CentOS) Server at localhost Port 80”

I assume I have apache configured wrong. All the tutorials I've found just shows this working so I'm not sure what is wrong.

I'm only using this for testing so I'm only interested in viewing the website via the localhost

I installed apache and mySql via yum. I wanted a specific php version so I installed it from source.

I created with the contents:

 <|?
 phpinfo();
 ?|>  

and it worked as expected. Note: added | so code would show up.

I installed Joomla at /var/www/html. I used a backup utility to install the software and fill the db with a website.

Here is an overview of what I'm doing to setup the machine Centos 6.3 machine.

yum install mysql-server mysql php-mysql
yum groupinstall 'Development Tools' -y
yum install httpd mysql-server httpd-devel libxml2-devel libcurl-devel libjpeg-devel libpng-devel gmp-devel mysql-devel libtool-ltdl-devel -y
wget http://museum.php.net/php5/php-5.3.6.tar.gz
tar -zxvf php-5.3.6.tar.gz
cd php-5.3.6
'./configure' '--with-mysqli' '--with-mysql' '--enable-bcmath' '--enable-mbstring' '--with-gmp' '--with-curl' '--with-gd' '--with-freetype' '--with-apxs2=/usr/sbin/apxs' '--with-zlib'  '--with-jpeg-dir' '--with-png-dir' '--with-gif-dir'
make
make test
make install
chcon -t textrel_shlib_t '/usr/lib/httpd/modules/libphp5.so'
echo 0 >/selinux/enforce 

in /etc/httpd/conf/httpd.conf add at bottom:

<IfModule mod_php5.c>
    AddType application/x-httpd-php .php .phtml .php3 .php5
    AddType application/x-httpd-php-source .phps
    php_admin_flag register_globals off
</IfModule>
share|improve this question

closed as off topic by SvW, mdpc, Ward, EEAA, Khaled Feb 9 '13 at 8:13

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

That's not how a CMS like Joomla works. Basically, all it pages are generated by calls to it's index.php with various parameters (e.g. the page id to display). A standard URL for Joomla then looks something like

 http://www.example.com/index.php?option=com_content&task=view&id=1&Itemid=1

To get it to display "real or SEO friendly" URLS (like http://example.com/contact), you will need to add some rewrite rules to Apache and then configure the CMS to handle these rewritten URLS, possibly with an extension module. For more info, see the Joomla documentation.

share|improve this answer
    
I have a .htaccess file setup. The site works fine on a windows xampp and a production centos server. I believe it is an apache setup issue. –  brian Feb 8 '13 at 22:29
    
You are mistaken in your understanding of this problem and closing this as off topic. I tracked the problem down to an apache config issue. The default config for apache is AllowOverride=None which will block mod_rewrite from working. I added a Directory command for /var/www/html that sets AllowOverride=all. This fixed the problem the sub pages. –  brian Feb 10 '13 at 18:28
    
@brian: It's off-topic because it's just a test/learning system, not a production environment. Please read the FAQ for more info. Also, you neglected to give the relevant information (e.g. the presence of the .htaccess) but added a lot of useless stuff instead. –  SvW Feb 10 '13 at 21:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.