jimmybobby
Posts: 29
Joined: Wed Feb 20, 2013 9:53 pm

Webserver - HTTP 403 forbidden

Tue May 28, 2013 3:00 pm

Hi there,

I need help with a problem, I have, apache2 installed, with php5 etc...


Now, inside my /var/www, I have more folders:

so my fill tree is more like: /var/www/main-site
Now, what I have is, at /var/www/index.html there is a link to a ".cshtml" file in /var/www/main-site


When users click on the link to go from 192.168.1.***/index.html to 192.168.1.***/main-site/index.cshtml

They are greeted with a nice HTTP 403 Forbidden error.


How can I give web users access to this "main-site" folder?



I am sure it is probably really simple, I just haven't learnt it.




Many thanks in advance.
It's fair to say I like obsolete/old technology. :)
A Level Comp Sci Student

jimmybobby
Posts: 29
Joined: Wed Feb 20, 2013 9:53 pm

Re: Webserver - HTTP 403 forbidden

Tue May 28, 2013 3:19 pm

Ok, I have now got it working so that the browser can access the file...

I did this:

Code: Select all

sudo adduser pi www-data
sudo chown yourusername:www-data -R /var/www
sudo chmod 0755 -R /var/www
sudo chmod g+s -R /var/www


One problem now is that all the web viewer sees is the raw code.


Any help?
It's fair to say I like obsolete/old technology. :)
A Level Comp Sci Student

User avatar
bltsandwich1
Posts: 60
Joined: Fri Feb 08, 2013 3:22 pm
Location: Chicago
Contact: Website

Re: Webserver - HTTP 403 forbidden

Thu May 30, 2013 12:56 pm

Are you able to view this from the Pi not getting the pure code?

I would also (if this is possible in your setup) take the code you are running on the pi and transfer it to your main computer. Then from here open up the file with your favorite browser and see what it looks like... I do all my HTML on my main computer and then transfer it over to the pi, and have never had a problem.

Hope this helps!
John
facebook.com/chicagoraspberryjam - join in the fun
Majoring in ChemE at the University of Houston.

jimmybobby
Posts: 29
Joined: Wed Feb 20, 2013 9:53 pm

Re: Webserver - HTTP 403 forbidden

Fri May 31, 2013 3:34 pm

It has worked on PC, as it was made in Microsoft WebMatrix 3 - when access in browser on pi, it just displays CSHTML code - is it because it is CSHTML, as HTML works fine... :/
It's fair to say I like obsolete/old technology. :)
A Level Comp Sci Student

User avatar
Curt Timmerman
Posts: 7
Joined: Sat Dec 22, 2012 3:02 am
Location: Big Lake, Alaska

Re: Webserver - HTTP 403 forbidden

Fri May 31, 2013 10:28 pm

jimmybobby wrote:It has worked on PC, as it was made in Microsoft WebMatrix 3 - when access in browser on pi, it just displays CSHTML code - is it because it is CSHTML, as HTML works fine... :/
The apache configuration file should determine how file extensions are handled. Looks like 'CSHTML' is not defined so the server is defaulting to plain text.

Curt

jimmybobby
Posts: 29
Joined: Wed Feb 20, 2013 9:53 pm

Re: Webserver - HTTP 403 forbidden

Sat Jun 01, 2013 6:43 am

Ok, noobish question - probably - how can I define CSHTML for apache?
It's fair to say I like obsolete/old technology. :)
A Level Comp Sci Student

User avatar
duberry
Posts: 379
Joined: Mon Jan 28, 2013 10:44 pm
Location: standing on a planet that's evolving. And revolving at nine hundred miles an hour

Re: Webserver - HTTP 403 forbidden

Sat Jun 01, 2013 11:23 am

jimmybobby wrote:Ok, noobish question - probably - how can I define CSHTML for apache?
idk
maby search
eg in http://httpd.apache.org/docs/ or http://wiki.apache.org/httpd/ !
lend me your arms, fast as thunderbolts, for a pillow on my journey.
If the environment was a bank, would it be too big to fail
so long; and thanks for all the pi

User avatar
Curt Timmerman
Posts: 7
Joined: Sat Dec 22, 2012 3:02 am
Location: Big Lake, Alaska

Re: Webserver - HTTP 403 forbidden

Sat Jun 01, 2013 6:02 pm

jimmybobby wrote:Ok, noobish question - probably - how can I define CSHTML for apache?
There are also apps (webmin for example) that make administration easier.

Curt

Return to “General programming discussion”