Links No Longer Work After Wordpress Server Migration - mysql

I had a Wordpress server running on a windows based WAMP server and I just migrated over to my main Ubuntu Server. The first thing I did was move the database over and then the files. After pointing the Wordpress config file to the new database, the home page loaded right up!
The problem is that the nav links or any other link that is NOT the homepage loads a 404 error.
I have tried pointing my Virtualhost to the .htaccess file and then also re-saving the permalinks in wordpress.
Here is my current Virtual host file
Virtual Hosts:
<VirtualHost *:80>
ServerName WherehouseMKE.com
ServerAdmin info#wherehousemke.com
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Related

How can I make an area of a website password protected through Apache?

I have been working on this for a while, and I am trying to use .htaccess and .htpasswd. Here is what I have done:
Performed with Apache using Raspberry Pi 3B+ with DietPi installed.
I created a new .htpasswd file and proceeded to enter password that I wanted.
Next, I redirected to /etc/apache2/sites-enabled/ where I edited 000-default.conf and changed the line of code:
<VirtualHost *80>
ServerName www.example.com
ServerAdmin webmaster#localhost
DocumentRoot /var/www/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/etc/"
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^https://%{SERVER_NAME%{REQUEST_URI} [END,Ne,R=permanent]
</VirtualHost>
Everything here is the same, except replace "example" with my domain.
This did not affect my site, so I redirected to /etc/apache2/ where I edited apache2.conf and added the line of code:
<Directory /var/www/etc/>
DirectoryIndex index.php index.html
Options Indexes FollowSymLinks
AllowOverride None
Require all denied
</Directory>
Once again, everything here is the same. etc is the file that I want to password-protect. This made the page that I wanted to protect completely inaccessible, and when I changed AllowOverride and Require all it just made the page completely open. How can I make it so that a password is prompted when you try to access the directory?

How to set up Masked Redirect with Google Cloud VM instances

I have a VM with multiple apps. for example:
32.32.32.01/app1
32.32.32.01/app2
32.32.32.01/app3
I have a domain name from namecheap and I want it to use it only for app1.
so www.mydomain.com should take me to 32.32.32.01/app1.
I created URL Redirect Records on namecheap for both aliases (www and #) but it is not working.
Do I have to also do some configuration at the google cloud side?
You need enter via ssh to the VM, you also need a Apache http server, and create a site: ex:
cd /etc/apache2/sites-available
sudo cp 000-default.conf siteName.conf
sudo nano siteName.conf
Add a configuration (i dont remember the exact config, but this can give you a idea of the file content)
<VirtualHost *:80>
ServerAdmin mail#server.co
ServerName domain.co
ServerAlias www.domain.co
DocumentRoot /var/www/site
...
Save the file and restart apache
sudo a2ensite siteName
sudo service apache2 reload

Error code 403 when using WAMP for custom website

When attempting to access a website i am attempting to host on my pc using WAMP i get the typical error code 403 forbidden. I have edited the apache config to allow all etc but still seem to get it, however i can see localhost and phpadmin from 127.0.0.1
Any other suggestions? i can attach my apache config or put it in a pastebin if needed
For reference im running Win10(64x) with WAMP Server 3.0.6 (64x)
I have followed multiple tutorials from youtube and stackoverflow but cannot seem to get it to work as most use commands given are from linux such as 'chmd' (i have used linux before therefor understand what this means but cant work out how to do the same thing via windows)
Try making virtual host and give access to all local user. Make sure you give access to
file -------> httpd.conf
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
#onlineoffline tag - don't remove
Require local
Require ip 192.168.0
</Directory>
Edit httpd-vhosts.conf As like:
file ------> httpd-vhosts.conf
# Virtual Hosts
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName smarthome
DocumentRoot "c:/wamp64/www/smarthome"
<Directory "c:/wamp64/www/smarthome/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Can't access localhost with wamp and Chrome

from today, when I go to localhost (http://localhost) after launch WAMP, in Firefox, as usual, everything is normal, but Chrome says "Forbidden, You don't have permission to access / on this server."
Anyone can help me please ?
Edit: Solved it for me.
This is an IPv6 problem. Google must have just updated Chrome.
First of all ensure that your hosts file has the following line and that it is uncommented.
::1 localhost
Next, open up your Apache config (httpd.conf) and add the following to the listen section:
Listen [::1]:80
Next, you need to edit you Directory statements in httpd.conf or your vhosts files. They probably look something like this.
<Directory "C:\path">
Options Indexes FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
AllowOverride All
</Directory>
Add an extra line after the 'Allow from 127.0.0.1' so it looks like this
<Directory "C:\path">
Options Indexes FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
AllowOverride All
</Directory>
For anyone running into this problem this is what worked for me on apache 2.4.17
host file is here: C:\Windows\System32\drivers\etc
httpd.conf is here: C:\wamp64\bin\apache\apache2.4.17\conf
httpd-vhosts.conf is here: C:\wamp64\bin\apache\apache2.4.17\conf\extra
I made sure that localhost was enabled in my hosts file:
127.0.0.1 localhost
::1 localhost
just remove the # at the beginning of the line.
make sure this line in un-commented in your httpd.conf
Include conf/extra/httpd-vhosts.conf
In my file it was line 518.
then add this to your httpd-vhosts.conf file:
<VirtualHost *:80>
ServerAdmin somerandomdude#whaaat.com
DocumentRoot "c:/wamp64/www"
ServerName localhost
</VirtualHost>
Then restart WAMP.
I don't know if that's the cleanest way of doing it(probs not). but it worked pretty well for me.
It happens the same to me. From today I can not access with http://localhost to my wamp files with chrome.
In Firefox or Explorer I have no problems.
You can use 127.0.0.1 while the problem is solved.
I had the same problem. This is how I solved it out:
I first added ::1 to host file,usually found at C:\Windows\System32\drivers\etc
Then I went ahead an opened my Chrome browser. I went to settings>advanced settings>Open proxy settings (under the title system)
In the new window that pops up go to 'LAN settings' then make sure you check 'Automatically detect settings'

How to rectify this virtualhost setup on Wamp?

Could anyone please help me with setting up this virtual host on my WAMP server?
I have read through several posts and blogs online and unable to get this set up.
I followed the procedure suggested here: http://www.ruifeio.com/2011/01/30/setting-up-virtual-hosts-on-wampserver/
When I do the above, my server hangs up. Presently I added the following to my C:/windows/system32/drivers/etc/hosts file
127.0.0.1 tsg.local
And I changed my httpd.conf Apache config file with Listen 90 since I am using Port 90
Plus, removed # tag as suggested in the above tutorial.
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
I also added the following to my httpd-vhosts.conf
<VirtualHost *:90>
ServerAdmin webmaster#localhost
DocumentRoot “C:\wamp\www\tsg\”
ServerName tsg.local
ErrorLog “C:\wamp\www\logs\tsg.log”
CustomLog “C:/wamp/www/logs/common.log” common
</VirtualHost>
And changed: NameVirtualHost *:80 to NameVirtualHost *:90
Thanks for helping out in advance!
If your server will start fine with the Virtual Host block removed, try fixing your quotes. It looks like you have some "magic quotes" instead of straight quotes - likely from copy and pasting from the tutorial. Try this instead:
<VirtualHost *:90>
ServerAdmin webmaster#localhost
DocumentRoot "C:\wamp\www\tsg\"
ServerName tsg.local
ErrorLog "C:\wamp\www\logs\tsg.log"
CustomLog "C:/wamp/www/logs/common.log" common
</VirtualHost>
You also might want to pick a more standard port to listen on, 8080 or 8888 rather than 90 if 80 is not an option.