wordpress forbidden 403 error - wordpress

After installing wordpress and following all the steps when I am go to http://localhost, I am gettong 403 Forbidden error.
How can I resolve this?
Ubuntu 14.04 is my OS.

In normal case changing permission and updating .htaccess should fix this issue, but in your case it is not working, so try to create a host entry and see if it is working. Else it will be related to the server configuration.
a. Create a new folder inside /var/www (example: wordpress - with proper permissions)
b. Copy all files from /var/www/html folder to /var/www/wordpress
c. Create a virtual host entry: sudo gedit /etc/apache2/sites-available/wordpress.conf
Add following contents:
<VirtualHost *:80>
ServerName wordpress
DocumentRoot /var/www/wordpress
<Directory /var/www/wordpress>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
</VirtualHost>
d. Update hosts: sudo gedit /etc/hosts
Add new line: 127.0.1.1 wordpress
e. Activate new website: sudo a2ensite wordpress.conf
d. Restart apache: sudo service apache2 restart
Access http://wordpress from your web browser.

Related

Symfony not loading up in EC2 instance AWS

I have a symfony website on digital ocean droplet, i am trying to migrate symfony website to aws ec2 instance. This is the tutorial i have followed : Deploy Symfony on Ubunut 14.04
I have followed each and every step according to the tutorial and have installed composer and other prerequisites needed. Here is the sites-available default config file for apache on my server :
<VirtualHost *:80>
ServerName miscellani.co
ServerAdmin info#miscellani.co
DocumentRoot /var/www/miscellani/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
But even after setting all the parameter files and everything apache is not loading up the correct index for the file but showing directories.
Output image
I have tried multiple tutorials but all showing the same output for symfony. If anyone can help me out here where i am doing it wrong or which file i need to install or redo any step it will be highly appreciated. Thank you.
Update :
Made changes as recommended by Jan but its still giving me the same parent directory rather than the website.
1st add to /etc/hosts:
127.0.0.1 localhost
127.0.0.1 miscellani.co
127.0.0.1 www.miscellani.co
Run in shell
sudo cp 000-default.conf miscellani.conf
edit miscellani.conf
Correct VirtualHost for Symfony is (miscellani.conf):
<VirtualHost *:80>
ServerName miscellani.co
ServerAlias www.miscellani.co
DocumentRoot /var/www/miscellani/web
<Directory /var/www/miscellani/web >
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
When add file run in shell command:
sudo a2enmod rewrite
sudo a2ensite miscellani
sudo service apache2 restart

WordPress multisite setup as subdomain - wildcard DNS record setup

I am new to WP multisite environment. I want to setup multisite in my local Ubuntu 14.04 environment. I already have localhost for my main site configured as carbazarlocal.com and its running OK. When I go to Tools > Network Setup I can see two options - Sub-domain and Sub-directory. I want to setup my multisites as sub-domains like dealer1.carbazarlocal.com, dealer2.carbazarlocal.com etc.
On this page WordPress says "You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality". How to do this and where?
In /etc/hosts I have the following entry:
127.0.0.1 carbazarlocal.com
In /etc/apache2/apache2.conf I have the following:
<Directory /var/www/html/carbazar>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
In /etc/apache2/sites-available/carbazarlocal.com.conf I have this:
<VirtualHost *:80>
ServerAdmin admin#carbazarlocal.com
ServerName carbazarlocal.com
ServerAlias *.carbazarlocal.com
DocumentRoot /var/www/html/carbazar
</VirtualHost>
And in /var/www/html/carbazar/wp-config I have this:
define('WP_ALLOW_MULTISITE', true);
What else I need to do and where to complete the following step:
"You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality"?
If you use Apache server then ...
In the httpd.conf file, or in the include file containing the VirtualHost section for your web account, add a line like this (if it is not already present):
ServerAlias *.example.com
Also create a wildcard DNS record like:
*.example.com A 192.0.43.10
REF https://codex.wordpress.org/Configuring_Wildcard_Subdomains

Error 503 Service unavailable

just started with Symfony2 and already have a problem that i can not solve.
Installed the Symfony2 demo app on a VPS with debian. but trying to open it give me a "503 Service unavailable".
I used 'symfony demo' to install to /var/www/symfony_demo/
then added a symdemo.conf file to /etc/apache2/sites-available that look like this:
NameVirtualHost XX.XXX.XX.XXX
<VirtualHost XX.XXX.XX.XXX>
ServerName symblog.dev
DocumentRoot "/var/www/symfony_demo/web"
DirectoryIndex app.php
<Directory "/var/www/symfony_demo/web">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
XX.XXX.XX.XXX = public server IP
and activated it with a2ensite symdemo.conf
I thought that would work, but opening the IP give me the error message.
and trying to open app_dev.php give me not allowed to access this file
Could someone please give me a tip?
Nevermind. Looks like i fixed it. Following this tutorial: http://intelligentbee.com/blog/2013/08/07/symfony2-jobeet-day-1-starting-up-the-project/
just activate mod_rewrite with a2enmod rewrite and restart apache. that's it.

EC2 AWS SSL issue in Wordpress for load assets

I have a wordpress blog in AWS that uses http.
Now I instaled a SSL certificate so I can use https.
All http://www.mysite.com works fine. All content loads and is perfect.
When I use https://www.mysite.com, all assets (images, css, js,..) are not loaded and got a console error that the server can't find in https.
Does anyone know a possible solution for this?
Installed mod_sll, restarted Apache, update yum, open port 443.... But nothing.
Thanks in advance
Seems like you didn't properly setup the SSL virtual host. if you use default ssl.conf in apache, make sure you add ServerName and ServerAlias accordingly.
If it still didn't work. Please backup your ssl.conf first and delete all the lines below
## SSL Virtual Host Context in ssl.conf and put following content in ssl.conf or as a new file in sites-enabled if you're using debian based.
Also dont forget to run netstat -nltp and see if port 443 is listing by apache. If not add listen 443 in your httpd.conf or ssl.conf
<VirtualHost *:443>
SSLEngine on
SSLProtocol -ALL +SSLv3 +TLSv1
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXPORT
## /etc/httpd/ssl/ replace with the directory which contains your PrivateKey,
## Certificate and Bundle file(if available)
SSLCertificateFile /etc/httpd/ssl/ssl.crt/your_domain.crt
SSLCertificateKeyFile /etc/httpd/ssl/ssl.key/your_domain.key
SSLCACertificateFile /etc/httpd/ssl/ssl.crt/bundle.crt
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ServerAdmin youremail.com
DocumentRoot /var/www/yourdomain.com/htdocs
php_admin_value open_basedir "/var/www/yourdomain.com/htdocs"
<Directory "/var/www/yourdomain.com/htdocs" >
Options -Indexes FollowSymLinks
allow from all
AllowOverride All
</Directory>
CustomLog /var/log/httpd/yourdomain-access_log combined
ErrorLog /var/log/httpd/yourdomain-error_log
</VirtualHost>

Setting Up WordPress MS Locally with Port 8888 with XAMPP

I have installed XAMPP and edited the httpd.conf file because my port 80 is busy.
So I have the following:
Listen 0.0.0.0:8888
Servername localhost:8888
Everything works fine until I try to install WordPress 3.0.5 MS because it will not accept ports in the name.
So I have tried to add .htaccess file to my htdocs that contains:
RewriteEngine on
RewriteRule ^:8888/(.*)$ /$1 [L]
But that did not work.
So I have tried to create Virtual Hosts in httpd.conf adding the following at the bottom:
<Directory "C:/xampp/htdocs/www/wp.dev">
Order Deny,Allow
Allow from all
</Directory>
<Directory "C:/xampp/htdocs/">
Order Deny,Allow
Allow from all
</Directory>
NameVirtualHost 127.0.0.1:8888
<VirtualHost 127.0.0.1:8888>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost2
</VirtualHost>
<VirtualHost 127.0.0.1:8888>
DocumentRoot "C:/xampp/htdocs/www/wp.dev"
ServerName wp.dev
</VirtualHost>
And then I added the following to my hosts file (Help):
127.0.0.1:8888 localhost2
127.0.0.1:8888 wp.dev
And that hasn't worked. I cannot use port 80 as an option, so I need to figure this out. So what am I doing wrong?
Unfortunately WordPress MS requires port 80 to work. You can check the requirements in this link
If using that port in your local machine is not an option for you, what you could consider is to work with a Virtual Machine. (This is the link to the BitNami WordPress virtual appliance in case you want to try it.)

Resources