LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-11-2008, 02:23 AM   #1
GTBlackwell
Member
 
Registered: Aug 2003
Location: MO, USA
Distribution: Mandrake 9.1/9.2(Laptop)
Posts: 117

Rep: Reputation: 15
Redirecting Apache2 to Wordpress site by default


Running Ubuntu 8.04 (Desktop) with Apache2 installed from repositories. It was all set up using this HOWTO, except I replaced the name of the blog directory, making it mydomain rather than wordpress. As a consequence, I have to go to http://www.mydomain.com/mydomain in order to view the blog. What I want is to just be able to type in www.mydomain.com and view the blog, without the subdirectory. I've set up a NameVirtualHost with the following configuration:
Code:
NameVirtualHost *
<VirtualHost *>
	ServerAdmin webmaster@localhost
	
	DocumentRoot /var/www/mydomain/
	<Directory />
		DirectoryIndex index.html index.php
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/mydomain/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog /var/log/apache2/access.log combined
	ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
but all that accomplishes is to give me an index page containing a link to the directory 'mydomain'.

I've tried simply placing the wordpress files and directory structure in www, but that jut makes all the php paths fail and everything on the page is broken. Surely I'm missing something simple here. I've tried creating a link named index.php targeted to the actual wordpress index file, which sort of works; I can type www.mydomain.com into the address box, though apache still redirects to http://www.domain.com/domain which looks kind of silly. There must be some way to accomplish this.
 
Old 09-11-2008, 02:45 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Add
Code:
ServerName www.mydomain.com
inside the <VirtualHost *> definition.
 
  


Reply

Tags
apache, directory, wordpress


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 - how to get rid of apache2-default ozymandias Linux - Server 4 09-12-2008 10:27 AM
Redirecting from old site to new site Sheridan Linux - Networking 1 02-02-2008 12:52 PM
apache2 vhost site makes default site inaccessible jyamada1 Linux - Server 4 01-17-2007 08:42 PM
LXer: Automating Web site and WordPress upgrades with Subversion, mirrorlinks and bash LXer Syndicated Linux News 0 11-11-2006 10:33 AM
apache2 Home practice site comprookie2000 Linux - Networking 3 01-19-2005 04:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration