I try this tutorial but nothing happen
http://guiem.info/permalinks-on-wordpress-amazon-ec2/
apache2.conf directory codes
<Directory />
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
#None
AllowOverride All
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory "/var/www/html/wordpress">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
Of course, I always restart apache every time I make a change
If I do not use permalinks wordpress works perfect
According to this article, this can happen when mod_rewrite module is not enabled in Apache configuration file.
Related
I manage 3 websites on one server instance. I set the Bitnami.conf like below
<VirtualHost *:80>
ServerName morethanair.com
ServerAlias morethanair.com
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
<Directory "/opt/bitnami/apps/wordpress/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
# Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>
<VirtualHost *:80>
ServerName microblog.morethanair.com
DocumentRoot "/opt/bitnami/apps/wordpress/microblog-wordpress/"
<Directory "/opt/bitnami/apps/wordpress/microblog-wordpress/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
# Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>
<VirtualHost *:80>
ServerName photo.morethanair.com
DocumentRoot "/opt/bitnami/apps/wordpress/photo-wordpress/"
<Directory "/opt/bitnami/apps/wordpress/photo-wordpress/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
# Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>
I can connect 2 sites with subdomain (photo.morethanair.com and microblog.morethanair.com), but the server error occurred when I try to connect morethanair.com.
When I type 'morethanair.com' in the browser, the URL changes to 'morethanair.com//' with double slash.
Any idea to resolve this?
I already tried to delete Wordpress and all plug-ins and reinstalled the latest Wordpress, but it didn't work.
Thank you.
I want to know if it's possible to have one apache website conf file with two vhost inside ?
More clearly :
For now if I access my website like this : XX.XX.XXX.XX I reach my wordpress folder.
Now, I want to access another folder like this : XX.XX.XXX.XX/interface
Is it possible to do it in the same conf file ?
Here is mine actually :
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/wordpress/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/wordpress/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
Thanks in advance
I'd like to set up 2 wordpress sites on the same ip adress, that is ip_adress1/wordpress1 and ip_adress1/wordpress2.
I put these 2 files into /etc/apache2/sites-available (these are basically the same, only site's path changes)
<VirtualHost *:80>
DocumentRoot /usr/share/wordpress/MyFirstSite/
ServerName my.ip.adr.ess
ServerAlias my.ip.adr.ess/MyFirstSite/*
ServerAdmin myemail#adress.ext
Alias /MyFirstSite /usr/share/wordpress/FolderForMyFirstSite
<Directory /usr/share/wordpress/FolderForMyFirstSite>
Options FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
<Directory /usr/share/wordpress/FolderForMyFirstSite/wp-content>
Options FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
and
<VirtualHost *:80>
DocumentRoot /usr/share/wordpress/MySecondSite/
ServerName my.ip.adr.ess
ServerAlias my.ip.adr.ess/MySecondSite/*
ServerAdmin myemail#adress.ext
Alias /MyFirstSite /usr/share/wordpress/FolderForMySecondSite
<Directory /usr/share/wordpress/FolderForMySecondSite>
Options FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
<Directory /usr/share/wordpress/FolderForMySecondSite/wp-content>
Options FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
It seems that the 2 sites in sites-available can work separatly when I enable them.
When I enable both of them simultaneously though, only one works. I think it's overwriting the other... (no apache error, by the way)
One other thing : the sites works when I reach http://my.ip.adr.ess (without the path for the site). And that I'dont't want it to !
What do you think ?
Many thanks in advance
Stanislas
I made this,finally, which seems better, after reading a bit more docs (https://httpd.apache.org/docs/2.2/mod/mod_alias.html) about apache configuration :
<VirtualHost *:80>
DocumentRoot /usr/share/wordpress
ServerName my.ip.adr.ess
ServerAdmin my.email#adress.ext
Alias /Alias1 /usr/share/wordpress/Folder1
<Directory /usr/share/wordpress/Folder1>
Options FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
<Directory /usr/share/wordpress/Folder1/wp-content>
Options FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
Alias /Alias2 /usr/share/wordpress/Folder2
<Directory /usr/share/wordpress/Folder2>
Options FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
<Directory /usr/share/wordpress/Folder2/wp-content>
Options FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
I have used virtualhost file in drupal to create multiple sites under one server. Also to remove /drupal from the url.
ex: 202.45.198.98/drupal this is how my URL looks like when ever I visit my website
After creating new Virtual host file for my website, I can see my website without /drupal in url.
Now the problem only the first page is loaded I mean some matter but not images, drupal template or any other links.
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName mysite
DocumentRoot /var/www/drupal
<Directory /var/www/drupal/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /var/www/drupal/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
AllowOverride All
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
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
You should check the settings.php inside sites/default folder. You will see a line something like --
# $base_url = 'http://www.example.com'; // NO trailing slash!
Remove the hash at the start & update the URL with the current URL you have for the drupal instance. Most probably you will solve your problem if your connection setting is correct at the same settings.php file (DB name, server name, username & password).
If you find problem due to clean URL in logging in then you may have to put manual path for logging in as admin, which will be --
YOUR_BASE_URL/?q=user/login
If you want to disable clean URL then you can write a extra line in your settings.php --
$conf = array(
'clean_url' => 0,
);
Have nice drupling :)
I'm having problems with setting up my apache2 server in Ubuntu.
I did a sudo apt-get install and it installed normally. I was able to see that the site was working when accessing localhost.
Then I'm not sure what happened, but I am no longer able to see the "It works!" website. When I try to restart apache2, it returns this:
Syntax error on line 17 of /etc/apache2/sites-enabled/000-default:
AddHandler requires at least two arguments, a handler name followed by one or more file extensions
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
Any ideas?
Here is my /etc/apache2/sites-enabled/000-default:
ServerAdmin webmaster#localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
DirectoryIndex index.html index.py
AddHandler mod_python.py
PythonHandler mod_python.publisher
PythonDebug On
</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
There is a problem on your config file. Try changing the line 14 by :
AddHandler mod_python .py