Unable to hit https for certain projects - apache

I have a project in xampp/htdocs/project1
I needed to create another project so I decided to assign them different ports so now,
xampp/htdocs/project1 runs on 8080
and my project2 which is under
C:/release/project2 runs on 7171
I needed to make project2 https , so created ssl certificate and everything is setup in apache too.(listening to 443)
https:/xx.xx.xx.xxx:443/project1/login.php gave error
whereas https:/xx.xx.xx.xxx:443/project2/login.php could be hit.
so i did following change in httpd-ssl.conf,
DocumentRoot "C:/xampp/htdocs" to DocumentRoot "C:/release"
but now i get the error -
Access forbidden!
You don't have permission to access the requested object. It is either
read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
This error is given for both,
https:/xx.xx.xx.xxx:443/project1/login.php
and https:/xx.xx.xx.xxx:443/project2/login.php
I thought it was permission problems, but i can still hit these
https:/xx.xx.xx.xxx:8080/project1/login.php
and https:/xx.xx.xx.xxx:7171/project2/login.php
What could be the problem? I am new to website development so could not figure out what I am doing wrong.Is project being under htdocs compulsory for this or assigning of different ports was wrong?

You might have got it working by now,
But It seems like the permissions are not set.
It is not compulsary to have the project under htdocs.Since your project is working on 7171 everything might be fine.
you can try following,
1) for permissions, Check if you have AllowOverride All Order allow,deny Allow from all set in httpd.conf too.Restart the server.
If it still doesnt work,
2) check if http://www.youtube.com/watch?v=ZUAKLUZa-AU can help.

Related

Problems with network shares using Apache on Windows server 2019 Standard

I am replacing an old web server running IIS 7 (?) with a new server running XAMPP (Apache 2.4) on a Windows Server 2019 Standard machine. I have a couple of network shares with content I need to display, but I cannot get Apache configured correctly. I am calling one such network folder "eom".
I created a new user specfically to run the Apache service, the user account has network access, and I have the service running as that user. That user (as well as my own user account) has full control/access to the network folder identified below.
I have tried simply identifying the network location with a block, like this:
<Directory "//OLDSERVER/data/eom">
AllowOverride None
Allow from All
Options +FollowSymLinks
</Directory>
Alias /eom/ "//OLDSERVER/data/eom"
In this case, "/data" is a shared folder. If I try it with the drive letter identified like "//OLDSERVER/c$/data/eom", Apache doesn't like it. It says the path is invalid.
I have also tried creating a symbolic link called "eom" and pointing to the same folder with this command:
mklink /D eom \\OLDSERVER\data\eom
When I created the symlink, I commented out the block in the config file. Nothing is working. No matter how I try it, the response I get is "403 Forbidden You don't have permission to access this resource."
I have also tried starting the web service as myself, especially when testing the symbolic link, but I always get the same result.
Any help is appreciated.
FINALLY figured it out! The steps are (all from the web server):
make sure you have access rights to the content you are trying to share
find the IP address of the remote server with the needed content
ping -a \OLDSERVER
navigate to your web root folder, in my case "c:\xampp\htdocs".
use "mklink" to create a symbolic link:
mklink /D eom \10.20.30.40\data\eom
add block in your httpd.conf file:
<Directory "/eom">
AllowOverride none
Allow from All
Options +FollowSymLinks
restart Apache
Now you can test. There may be other ways to do it, but this is what has finally worked for me.

serving laravel with apache vhost

I followed instructions and added in my httpd-vhost.conf file
<VirtualHost *:80>
ServerName project-laravel-learn.my
DocumentRoot "/srv/http/project-laravel-learn.my/public/"
</VirtualHost>
also added like for other local projects, map in hosts file so that
project-laravel-learn.my goes resolves to 127.0.0.1
http (web user), has all permissions to write and read on that public
folder,
also app/storage is rw- for http,
however, when I visit project-laravel-learn.my I get page saying
Whoops, looks like something went wrong!
What might be the problem? Also how I can get more detailed error message as
this one above isn't that much useful.
Just to add, app was working fine before I moved it to /srv/http/, while developing and using php artisan serve command.
EDIT: Ok it works, I forgot to start my local web server instance, however now routing does not work, I get only homepage, but clicking on any link gives 404 object not found error!?
How to fix that?
Found solution here..
http://www.epigroove.com/blog/laravel-routes-not-working-make-sure-htaccess-is-working
I will leave it for a future reference.

iis and apache combination on real server for 403

We have a win2003 server that run both IIS 7 and apache (using wamp server 2.2).
We put on both server a page named test.html that show us a message that say "You are on IIS page" and "You are on WAMP page" to show us if everything is working correctly.
Both running real great locally. IIS is listening on port 80 and apache on port 8082. The problems come remotly. Both services are running and wamp is fully online (green icon + "put online" option activate).
Locally, on the server, doing http://localhost/test.html and http://localhost:8082/test.html show the correct pages. If we replace localhost by real IP address (for example purpose, let say http://10.2.5.16/test.html and http://10.2.5.16:8082/test.html), still work. (not actual address but address used for real is the same used by dns web service)
Remotly, from any other PC, doing http://10.2.5.16/test.html and http://10.2.5.16:8082/test.html, the first give us the website normally, the second give us a HTTP 403 FORBIDEN (tried using both htaccess and windows permission, still have 403). The same way, using http://www.ourdomain.com/test.html and http://www.ourdomain.com:8082/test.html give us the exact same result (first ok, second 403)
Is it possible to make it work correctly?
Thanks in advance.
edit: Just to add to the solution :
the firewall was blocking me, add the wamp on this port allowed
in my configuration, i had in my directory statement Require local, which needed to be set to Require all granted
for the rest, the solution was pretty it.
Thanks again.
The fact that you can get to the sites locally tells me both servers are setup correctly and listening on respective ports.
Upon further questions, the OP indicated that the Servername Directive, is pointing to localhost and it should be changed as.
ServerName localhost:8082
To
ServerName example.com:8082 # or add "ServerAlias example.com:8082" to your existing.
Where as example.com is your site DNS. Then in your [System32\drivers\etc\hosts] point that DNS to the ip of your Remote host.
403 is happening because the request from the remote is not matched against any Servername or ServerAlias and it falls to the default handler which normally has stricket permissions. If you look closely in logs(/logs/apache/access.log), there should be something about "access denied by server configuration /somelocation like your default DocRoot"
If you make request for http://example.com and you have correct ip in your hostfile, you can trace what happens to that request in the remote host and where it ends up(firewalls, Apache etc). Apache is good at logging and you just need to find relevant log entries!

WAMP server not accessible from a different computer on the same network

I have on my laptop a WAMP server as my local server. On this server i am hosting a webpage just for local use.
I also have registered a free domain name for my server from dyndns.org. I'm using dynamic DNS by running a software from dyndns.org.
When i try to access my server and view the website which i am hosting on it using my browser, by typing localhost or my free domain name, it works just fine.
But the problem is that when a friend of mine sitting right next to me(on the same local network) tries to visit my webpage from his laptop, he gets an error message saying:
"You don't have permissions to access this server" .
I configure the httpd.conf file after i installed the WAMP server and changed only the DocumentRoot and the Directory to a folder of my choice inside the www folder.
Also i changed the ServerName to be my free domain name.
I don't think that the above are the problem. So , anyone has a clue of what might be wrong here ?
Did you try writing this:
<Directory yourdir>
Order Allow,Deny
Allow from all
</Directory>
Nope neither that worked. But after messing around with the httpd.conf file i found the solution. In the
< Directory yourdir >
Order Allow,Deny
Allow from all
# I had to put this line also
Require all granted
< /Directory>

Apache not allowing access to sub directories

I installed Apache2, php, and mysql onto my Linux Mint machine with the hopes of continuing a website I had built. After copy and pasting all of the code I had I noticed a problem with one of my include statments:
<?php include("./dir/file1.html");
That wasn't working. Originally I thought the issue was with php but after a lot of trial and error I've concluded it's apache not allowing access to subdirectories in the /var/www/ directory.
Since I'm new to editing apache configuration files, I'm not really sure what to change to allow access to all subdirectories within /var/www/ on localhost. I've tried adding:
<Directory /var/www/*>
order allow,deny
allow from all
</Directory>
to my httpd.conf file (which was blank, which I learned had something to do with Linux Mint being Debian based) and confirmed that default in /sites-available had similar code. I'll post that if it's requested.
I'm unsure on what else I can do to get apache to allow access to subdirectories in my /var/www/ directory for localhost and none of my previous methods have worked.
UPDATE:
I believe it's an Apache issue because when trying to go to a subdirectory through the browser (like localhost/dir/), I get a 403 error. I don't have to be going to an actual webpage for that problem. Also, include statments including files in the current directory has no problem, only with subdirectories.
The Include statement above gives no errors or any other useful messages. Whatever the include statement is including is just not there. I've tried require but that gives me a 500 server error: the server may be down for maintenance (paraphrased).