Problems with network shares using Apache on Windows server 2019 Standard - apache

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.

Related

Unable to get access to specific directory to run a site on ec2

Still fairly new to ec2, I made a new directory as /home/user/www. Opened ftp service that allows git commits to be pushed to the server. This works fine as I can see the files come up. The problem being when I run my site, the Apache test page pops up and when I try opening a page in /home/user/www directory, it says Forbidden, you don't have permission to access / on this server.
I have successfully changed the DocumentRoot
DocumentRoot "/home/user/www"
AllowOverride None
# Allow open access:
Require all granted
and Directory in httpd.config to /home/user/www, all but to no result.
Any help is appreciated. Permissions are 777 for test basis but still no success. User is the owner of all the files in www
Solved my own question. Permissions need to be set on the third directory i.e., www. Therefore, I did chmod 755 ~/www.
Worked like a charm

What is the easiest way to run a local server of a website built using ColdFusion with Coldspring, Reacter, and Model-Glue?

Here is the situation: I was given a machine with a subversioned repository of an old website to update/add contents every now and then. The website is built using ColdFusion and Model-Glue MVC, AND I have no idea (zero) about ColdFusion. The other website we run is on CakePHP and that is good enough learning curve for me. ;(
With that said, I don't have a problem modifying it's contents because its all HTML and javascript. The problem is that with each minor change, I have to commit to the development repository on the server THEN go online to see how the change looks like!
It gets very frustrating just to try different values for a simple thing like the "height" attribute of an html tag!! And what frustrated me even more is trying to run a local copy on my machine for that repository!
What I tried so far:
I installed CF10 with WAMP.
Configured vhosts file for the new server.
Added my user to ColdFusion Application server service (windows 7x64)
But whenever I try to open it in the browser it gives me "Exception Service Error Application Exception"!! Any help please?
**Update: I forgot to ask! how to know the index.cfm file that the website starts with? For example, I know in CakePHP its app/webroot/index.php. What is that in (Coldfusion X Model-Glue)? there are so many index.cfm and application.cfm files!
my httpd-vhosts.conf block about this server is like the following:
<VirtualHost *>
ServerName localhost-CF
DocumentRoot "C:/wamp/www/my/webroot/directory/"
<Directory "C:/wamp/www/my/webroot/directory/">
Options Indexes FollowSymLinks Includes ExecCGI
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.cfm index.html index.php
</VirtualHost>
Here is a link to a Screen Cap --no enough rep ;{ -- of what I get using both servers (not at the same time though) apache and built-in:
CF10 Local Server Setup Issue
Also, here is a block from cfusion\logs\application.log:
"Error","ajp-bio-8012-exec-1","08/15/13","10:34:38","PREK","Error during init: Could not find the ColdFusion component or interface coldspring.beans.DefaultXmlBeanFactory. Ensure that the name is correct and that the component or interface exists."
"Error","ajp-bio-8012-exec-1","08/15/13","10:34:38","PREK","Error during exception service init: Element EXCEPTIONSERVICE is undefined in a Java object of type class [Ljava.lang.String;. "
"Error","ajp-bio-8012-exec-1","08/15/13","10:34:38","PREK","Error during application init: The datasource named cfclientstorage is not a valid client storage DSN. Define client storage DSN through the ColdFusion Administrator."
I do have cfclientstorage as a DSN storage and the Administrator tells me its verified!
However, I think, if this exact repository works fine on the server then I should not worry about the code! it most likely a system/server configuration or installation problem (on my local machine).
It looks like you're using ColdSpring. You need to login into ColdFusion Administrator and add a mapping to your ColdSpring directory for example:
/coldspring --> c:/ColdSpring
Also you will need to set a datasource to point to your "cfclientstorage" database. This is also in ColdFusion Administrator

Apache always get 403 permisson after changing DocumentRoot

I'm just a newbie for Apache. I just installed apache 2.2 on the FreeBSD box at my home office. The instruction on FreeBSD documentation is that I can change the DocumentRoot directive in order to use the customized directory data. Therefore, I replaced...
/usr/local/www/apache22/data
with
/usr/home/some_user/public_html
but something is not right. There's index.html file inside the directory, but it seems that apache could not read the directory/file.
Forbidden
You don't have permission to access / on this server.
The permission of
public_html
is
drwxr-xr-x
I wonder what could be wrong here. Also, in my case, I am not going to host more than one website for this FreeBSD box, so I didn't look at using VirtualHost at all. Is this a good practice just to change the DirectoryRoot directive?
Somewhere in the apache config is a line like:
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/usr/local/www/apache22/data">
You must change this path too, to make it work. This directive contains for example:
Order allow,deny
Allow from all
Which give initial user access to the directory.
one possibility that comes to mind is SELinux blocking web process from accessing that folder. If this is the case, you would see it in selinux log. You would have to check the context for your original web root with:
ls -Zl
and then apply it to your new web folder:
chcon whatevercontextyousaw public_html
Or, instead, if its not a production server that requires security (like a development machine behind a firewall), you might want to just turn selinux off.
Just one idea. Could be a number of other things.

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).