Problems with Apache server on linux

wrcloebfan

New member
Hello guys,
I've been trying to setup home dedicated server since last 2-3 days on my old pc for learning and as a hobby purpose, first I tried it with windows xp it worked as a charm, but now as I mentioned in my earlier thread I want to do same with linux, I've got a copy of backtrack5 r3 so I installed it on my old PC and did fresh setup of LAMP Server in it, it worked properly both on LAN and on WAN so I copied the website files of my windows server to it, but then problems started to come when I opened it from localhost and from LAN it's just showing me plain text rather then my original page, I'm attaching both the images below that how my page should actually look and what it is looking like when accessed through localhost and LAN.

Actual Page -

screenshot_actual.jpg


Page looking like on server -

screenshot_localhost.jpg


Can anyone help me regarding solving this problem? I really don't know what's happening. :unknown:
 

Peter

Member
So is that the correct HTML file that is shown only that the images (and possibly other files) are missing? If that's the case you probably have the file paths wrong or the files are missing.
 

wrcloebfan

New member
Peter said:
So is that the correct HTML file that is shown only that the images (and possibly other files) are missing? If that's the case you probably have a problem with the file paths or the files are missing.

No file path is totaly correct the above shot I've taken is from the same directory in which it is hosted just the difference is the first file I opened from computer directly by accessing index.html and the other file I opened on LAN via my other device also if I open that same file via localhost on same device then also the problems occurs.


igdesigner said:
Yeah I think so, I had similar problem before :)

Can you tell what kind of problem is this maybe its same case here? Backtrack is ubuntu based distribution only though CentOS is REHL based but still I guess the problem could be same. :pardon:
 

GigaGreg

Moderator
Staff member
Problem might be because of the windows to linux.

I had the same problem when I've send from a MAMP(Mac Server) to Windows, I had the same problem, and had to re-code the website on windows.

There are different issues with that to be honest...
 

wrcloebfan

New member
igdesigner said:
Problem might be because of the windows to linux.

I had the same problem when I've send from a MAMP(Mac Server) to Windows, I had the same problem, and had to re-code the website on windows.

There are different issues with that to be honest...

I already tried recoding it but still not solved :unknown:
 

Peter

Member
I mean the file paths in the HTML document. If you have used absolute paths (e.g. C:/blabla/img.png) or relative paths that goes behind the site root (e.g. .../img.png) they will of course not work when you view them from another computer. Do you see the images if you type the URL into the browser address bar?
 

GigaGreg

Moderator
Staff member
Have you installed Apache Server through the command line console?
On CentOS you use: yum command, other distros such as debian: apt get

Within Apache Server you will have to install different libraries such as PHP and other ones that would allow you to display websites properly.
 

wrcloebfan

New member
Thanks a lot @Peter and @igdesigner for taking time out for suggesting me the solutions to the problem, however I figured out what really was the problem, I didn't set up chmod to 777 in the folders in var/www so I just did it simply in terminal by setting -
Code:
sudo chmod -R 777 /var/www
and bang it worked, problem solved :yahoo:
 

GigaGreg

Moderator
Staff member
No problem man, i thought about chmods but wasn't sure as I said that there might be a lot of different solutions to fix that problem.
 

GigaGreg

Moderator
Staff member
speedsonic said:
might want to install xamp for an instance in your linux for easy website setup
my opinion of course

Xamp is for windows
Lamp is for linux
Mamp is for Mac

You cannot install Xamp on linux because it wouldn't work at all.
 

Peter

Member
WAMP is for Windows. The X in XAMPP stands for cross-platform so it can be used on many different operating systems.
 

wrcloebfan

New member
igdesigner said:
speedsonic said:
might want to install xamp for an instance in your linux for easy website setup
my opinion of course

Xamp is for windows
Lamp is for linux
Mamp is for Mac

You cannot install Xamp on linux because it wouldn't work at all.
I would like to correct you here bro as mentioned by @Peter, in XAMP X stands for cross platform so its available for all 3 Windows, Linux and Mac :smile: but I personally didn't wanted to use that on my linux server because I wanted to do everything manually in order to learn and explore :wink: