Error 403 when trying to access localhost - wordpress

Good morning all.
I run a small in office dev (xampp) server for the build of static and WordPress websites on my Ubuntu machine.
I use vhosts for which two are workingabsolutly fine. However, I have another which for some reason keeps failing when I try to load the site.
My Xampp install is a typical /opt/lampp install, nothing unique or special.
My vhosts File
##Summerschool Development Version (which works fine)
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/summerschooldev"
ServerName summerschoolforteensuk.com
<Directory "/opt/lampp/htdocs/summerschooldev/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
##Summerschool old website (which works fine)
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/summerschool"
ServerName summerschoolold.com
<Directory "/opt/lampp/htdocs/summerschool/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
##scp old website throws error 403 You don't have permission to access / on this server..
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/scp"
ServerName scpold.com
<Directory "/opt/lampp/htdocs/scp/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Now my hosts file
127.0.0.1 summerschoolforteensuk.com
127.0.0.1 summerschoolold.com
127.0.0.1 scpold.com
From what I can see, everything seems to be working fine. Im relativly new to working like this but poor internet speed at my office means I have to. Im guessing that there is not error here as the other two sites work fine.
Is there something Im missing if not where would I look next.
Thanks

I seem to have solved this by installing wordpress locally and importing my database and wp-content folder into the install and using the full domain for the server name and host.
Dont think this has solved my issue but its working now.

Related

Wordpress Ubuntu redirects DigitalOcean Issue

Good day:
I have my website in digitalOcean, in Ubuntu Droplet. I have both Wordpress site and CakePHP sites. CakePHP is working well.
Wordpress I have a little issue:
If I access for example www.mywebpage.cl then it shows my "Apache2 Ubuntu Default Page" page (apache1.jpg attached):
If I access on my browser:
http://www.mywebpage.cl/alianzaWordpress/datos1/ then it goes to my webpage (mysite.jpg).
I want to go to www.mywebpage.cl and automatically directs to http://www.mywebpage.cl/alianzaWordpress/datos1/
I have tried to modify /etc/apache2/sites-available/000-default.conf with no success.
I have tried set DocumentRoot as /var/www/html/alianzaWordpress/datos1 or but still not working properly
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
#DocumentRoot /var/www/html/alianzaWordpress/datos1
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
After I modify I do "a2enmod rewrite ; service apache2 restart"
enter image description here
Please any recommendation is fine for me, also I am using permalinks "post names" in my site. (permalinks.jpg)
Regards,
Felipeenter image description here
Pictures
I found something easy to do, thanks anyway.
I modifed this file /var/www/html/index.html with this information to redirect to the folder I wanted:
<meta http-equiv="Refresh" content="0; url=http://www.mywebpage.cl/alianzaWordpress/datos1/">
Sorry for easy question, now I learn, Regards,
Felipe

wordpress site working locally but not from the domain

My wordpress site is working locally in my wamp server, this is hosted on an ec2 instance and domain is maintained in Route 53\cloudfare. The domain is working when i checked it using mxtoolbox. The site was working and live till the time i changed my host file in the server. I removed the host file entries accidentally thinking it is a dev site, however i restored it but still the site is not working and i am getting only the "TOO MANY REDIRECTS" error. The following is the current windows host file details
#
127.0.0.1 localhost
::1 localhost
127.0.0.1 mydomain.com
::1 mydomain.com
I restarted the server and WAMP multiple times but it is not working.
The following is my virtualhost configuration
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName mydomain.com
DocumentRoot "c:/wamp/www/sitefolder"
<Directory "c:/wamp/www/sitefolder/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.mydomain.com
DocumentRoot "c:/wamp/www/sitefolder"
<Directory "c:/wamp/www/sitefolder/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>`
Clean your cache and browser history first, then try doing it below:
Open your wordpress admin panel --> Settings--> General --> Make sure it points to the correct domain. --> Save
Or go to the wp-config.php file (Try this if the first method fails / can't be accessed)
add:
define('WP_HOME','http://YourDomain.com');
define('WP_SITEURL','http://YourDomain.com');
or
Try to remove or rename default .htaccess
or
Try to disable the plugin (renaming the plugin folder in the "wp-content/plugin/plugin-folder-name" will non-active that plugin. This might solve the problem if the constraints are due to the plugin)
That's a number of ways when I resolve the ERR_TOO_MANY_REDIRECTS problem. Goodluck

editing httpd.conf on apache

I'm trying to make my apache visible on my local network for being able to acces my wordpress site hosted there, by editing httpd.conf file on /bin/apache/conf/ and im getting a Permision Error, but I can't find any clear content on the Internet.
Im using UWAMP 3.1.0 and It must be something related with this part of the code:
<VirtualHost *:80>
#UWAMP Generate Virtual Host
DocumentRoot "F:/UwAmp/www/"
ServerName "main-serveur"
Alias "/mysql/" "F:/UwAmp/phpapps/phpmyadmin/"
Alias "/mysql" "F:/UwAmp/phpapps/phpmyadmin/"
Alias "/uwamp/" "F:/UwAmp/phpapps/uwamp/"
Alias "/uwamp" "F:/UwAmp/phpapps/uwamp/"
<Directory "F:/UwAmp/phpapps/phpmyadmin/">
AllowOverride All
Options FollowSymLinks Includes Indexes
Require local
</Directory>
<Directory "F:/UwAmp/phpapps/uwamp/">
AllowOverride All
Options FollowSymLinks Includes Indexes
Require local
</Directory>
<Directory "F:/UwAmp/www/">
AllowOverride All
Options FollowSymLinks Indexes
Require local
</Directory>
more concretely at the end:
<Directory "F:/UwAmp/www/">
AllowOverride All
Options FollowSymLinks Indexes
Require local
</Directory>
This is what I get after entering the IP where the site is hosted.
sorry for asking something so simple but I'm learning
Thank you in advance
{ONLINE_MODE}
If UwAmp is on Online mode, your website is available for all.
{ONLINE_MODE} will be replaced by :
Order allow,deny
Allow from all
If UwAmp is on Offline mode, your website is available only for your computer.
{ONLINE_MODE} will be replaced by :
Order deny,allow
Allow from 127.0.0.1 localhost

I cannot get Vhost to host multiple wordpress websites on centos 6.8

Issue: I cannot make the webserver host multiple websites.
Solutions I have tried:
I made two different Vhost.conf for the different websites(named differently according the website name but with the .conf extension. I then targeted different document roots linked to the websites within these config files. – Failed, displayed “connection refused”
I then went to the second website directory I created and change the file permissions to 755 (and 777 just incase) to check if that was conflicting and creating the issue, this also failed and made the same error.
Also all files have “chown -R root:root dir/ “ on.
I then went on to open port 8080 in iptables and changed the targeted port in the vhost of the second website to 8080, this also failed with the same error.
I tried finding the second website using “ip:8080, ip/secondwebsitedirectory, ip:80/secondwebsitedirectory” none of these worked. I followed each step of multiple tutorials online and none of these worked.
When I tested just making a directory and displaying the <?php phpinfo; ?> in index.php within the directory, then targeting that with the document root of the first virtual host block, this worked but did not display the second block’s website (I used the domain to link the alias to this and forwarded the domain to the servers ip).
My current vhost.conf file looks like this **NOTE: I removed ip’s and domains on clients request. They do work and have been tested so that isn’t an issue. Anything with “testsite” was originally the clients domain. **
I have made it two separate VirtualHost blocks previously and had the same result as I am having currently, I have had <VirtualHost *:80> on both blocks too.
<VirtualHost *>
ServerAdmin webmaster#testsite.org
ServerName ea
ServerAlias *server ip was here*
DocumentRoot /var/www/html/ea
ErrorLog /var/www/html/ea/logs/error.log
CustomLog /var/www/html/ea/logs/access.log combined
ServerAdmin webmaster#testsite.org
ServerName testsite
ServerAlias www.testsite.co.uk
DocumentRoot /var/www/html/testsite/public_html
ErrorLog /var/www/html/testsite/logs/error.log
CustomLog /var/www/html/testsite/logs/access.log combined
</VirtualHost>
The end result I want to come to is to be able to host multiple sites on my cloud server, these website are using Wordpress as that is the development platform I have been instructed to use and the server is running Centos 6.8 with all php and apache2 installed and working on one website.
As to a conclusion to this, I am stumped and need your help.
You need one statment for each site you want
<VirtualHost ea.mydomain.com:80>
ServerAdmin webmaster#testsite.org
ServerName ea.mydomain.com
ServerAlias ea
DocumentRoot /var/www/html/ea
<Directory "/var/www/html/ea/">
Options FollowSymLinks Indexes
AllowOverride None
# Use require all granted for apache 2.4
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/www/html/ea/logs/error.log
CustomLog /var/www/html/ea/logs/access.log combined
</VirtualHost>
<VirtualHost testsite.mydomain:80>
ServerAdmin webmaster#testsite.org
ServerName testsite.mydomain
ServerAlias testsite.mydomain testsite
DocumentRoot /var/www/html/testsite/public_html
<Directory "/var/www/html/testsite/public_html">
Options FollowSymLinks Indexes
AllowOverride None
# Use require all granted for apache 2.4
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/www/html/testsite/logs/error.log
CustomLog /var/www/html/testsite/logs/access.log combined
</VirtualHost>

Can't get to subsites. Wildcard-subdomains probably misconfigured in Apache

I'm building a portal for the organization I'm working at.
The portal is a Wordpress site using Wampserver 2.5, intalled on a Win server 2008 R2.
It's working fine and accesible from other machines over the intranet, thanks to the helpful and patient RiggsFolly.
But now, I have changed it into a network of sites so that I can build sub-portals for the different departments in my organization.
During that change Wordpress gave this warning message: Warning! Wildcard DNS may not be configured correctly!
Wordpress has a page explaining how to configure wildcard subdomains on Apache - http://codex.wordpress.org/Configuring_Wildcard_Subdomains.
I tried following it but the explanation lacks details and I'm probably doing something wrong.
On the machine where the servers and site are installed, when I write http://hipo (hipo is the current site name) in the browser's address bar, I get to the site fine.
But when I write http://depa.hipo (depa is a subsite I created successfully), the address changes into http://www.depa.hipo/ and the browser says it didn't find a server at that address.
I have probably set the ServerAlias line wrong in httpd-vhosts.conf, and also I didn't add the line *.example.com A 192.0.43.10, or in my case *.hipo A <rightIP>, cause I wasn't sure where to add it in the file.
This is my httpd-vhosts.conf file. Your help is appreciated!
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/hipo"
ServerName hipo
<Directory "c:/wamp/www/hipo">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/hipo"
ServerName subsites.hipo
ServerAlias *.hipo
<Directory "c:/wamp/www/hipo">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
This definition does not have a ServerAlias so try adding one like this:
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/hipo"
ServerName hipo
ServerAlias www.hipo
<Directory "c:/wamp/www/hipo">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Resources