Sorry if this has been asked before but I looked through other posts and couldn't find my answer.
Wordpress is up and running inside /var/www/wordpress/ However when I browse to www.mysite.com I get a listing of files & folders like the following:
Index of /
Name Last modified Size Description
index.html 12-Mar-2013 18:31 177
wordpress/ 08-Jan-2012 17:01 -
Apache/2.2.22 (Ubuntu) Server at www.mysite.com Port 80
If I click on the wordpress directory, I am brought to my site.
I asked a friend and he said modify .htaccess but there is no file with such name in /var/www/
How do I get apache to set my default homepage/directory to /var/www/wordpress/(index.php) ?
I tried uncommenting ServerRoot "/var/www/wordpress"
But this led to errors trying to restart apache: -cannot find ports.conf -cannot find conf.d things went downhill from there...
Do I modify sites-available/default?
Do I modify apache.conf?
Do I add an .htaccess file?
Also, since this is a new setup, how do I secure the installation which I read a lot of people use a specially crafted .htaccess file?
Thanks for your help!
Contents of sites-available/wordpress:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/wordpress/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/wordpress/>
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 ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Contents of sites-available/default:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
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 ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Contents of sites-enabled:
[email protected]:/etc/apache2/sites-enabled# ll
drwxr-xr-x 2 root root 4096 Mar 20 19:58 ./
drwxr-xr-x 7 root root 4096 Mar 20 19:29 ../
lrwxrwxrwx 1 root root 26 Mar 12 18:31 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 28 Mar 20 19:58 wordpress -> ../sites-available/wordpress
You need to add the
ServerName
directive to your VirtualHosts, so your web server will know how to route the requests. Also be sure to restart your web server after you make configuration changes.Also note that, depending on your situation, you may also need to add the
ServerAlias
directive to one or more of your VirtualHosts.See here for more info:
Name-based Virtual Host Support
Do you only want to host one site (a wordpress site)? You can either add a .htaccess file to redirect, or you could use a virtualhost setting in apache to point to yoursite/wordpress as the document root. There are a lot of ways to do it. When you install wordpres it should have an .htaccess file I thought. If you are using .htaccess you will need an allow override directive for your wordpress section of your httpd.conf/apache.conf. Perhaps you can just dump the contents of your wordpress folder into your current document root. Either w
View this link http://wiki.cnic.edu.cu/index.php/Adicionar_sitio_web_al_apache
This is my configuration in apache2 "wordpress.conf":