Linking in localhost(LAMP) - linux

I am newly(about 1 month) started using LAMP and Bootstrap.
I developed a web-site that worked perfectly until I reinstalled LAMP.
Here my progress:
0. reinstalled LAMP
1. moved my "backup-ed" file to my "localhost" direction
2. I run "chmod 777 *" to each dir and file
3. When I write "localhost" to my browser(firefox) the "index.html" is running
4. When I click the link(say: index)
The browser responds:
http://localhost/undefined
Not Found
The requested URL /undefined was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Is there any way to fix this, by the way it's working(linking) perfectly when I write file:///var/www/html/index.html.
The reason why I want to use LAMP is add .php files to handle form.
Thanks

What happens when you do hit http://localhost ?
What exactly do you see?? Tried http://localhost/html
What is exactly your document root as per apache conf?

You might need to check that you are placing your files in the root directoy. It should be in the "htdocs" foler.
/opt/lampp/htdocs/
If all else fails, you can try using xampp which is another free alternative to lamp.

I get this a lot, when your browser looks for a file that is not in htaccess you get a forbidden or unfound error. The way to fix this is to make sure the link you click goes to an accessible URL. Try finding if other links in the page or scripts are overwriting your link.
Finally check if you can access it from another browser, or try to demonstrate the security of your machine. From a public library you can request an Ubuntu CD from canonical, and while you're waiting, you can visually inspect your machine for tampering.

Related

Serving Node.js files from a LXC Turnkey container -Apache configuration needed?

I hope that I will not waste everyone's time, nor embarrass myself, but please hear/read my problem. I am new to this, so please bear with me.
Someone at work wrote a crude code in Node.js and I can see the .html files by having localhost: 8080 as the URL in the browser, while having the VisualStudio starting the npm with npm start command. Am I explaining this clear enough?
The webpages are displayed and all, but now comes the hurdle.
How can i have those pages served from a a Linux server?
If by analogy, I put some.html page inside the /var/www/ in a Apache server, pointing to the server's IP/somepage.html i can visualise it, what needs to be set up on a similar Node.js server?
Where do I have to put those files, inside what directory and what configuration is needed?
I thought to create a small LXC container and have those files and services saved as a template, but first I need to set this up correctly. Can Apache serve those files, do I have to make another configuration first?
I have those files served from a Windows machine from local host, and put the same files in a /node ,/opt/ www directory in a Linux machine, but no dice.

Image Path from ubuntu Server

I need some help for referencing the image present in the Ubuntu server. My image path in Ubuntu server "/home/Ubuntu/Chat/public/images/directions-icon.jpg". When i try to open the saved html its not displaying any thing. I thing its referencing my Laptop path. How to excursively mention a Ubuntu Path over here. Please Help Me. Thank you all.
My Code:
<html>
<img src="/home/Ubuntu/Chat-BOT/public/images/directions-icon.jpg">
</html>
Error: Not Displaying any thing
Just check the following things for diplaying the image
Ubuntu is a linux based operating system and its paths are case sensitive make sure you give exact path
Secondly their might be a permission issue for accessing the directory. You must atleast have read permission to show the image. Run "sudo chmod" command to change the permission of your desired directory.
Thirdly, make sure that the path you are giving is in the www or public web directory of your web server. Because if you are running your pages as a localhost the relative paths mostly starts from the folder within www or web directory example if file is in
/www/images/image.png
The relative path will be
src="/images/image.png"
Which means path according to local web address is
http://localhost/images/image.png
Thanks.
Perhaps you should start by checking you path again
/home/Ubuntu/Chat/public/images/directions-icon.jpg
and
/home/Ubuntu/Chat-BOT/public/images/directions-icon.jpg
are not exactly the same.
You seem to be referencing Chat-Bot while you probably meant to reference Chat (or probably vice-versa)

Symlink to raspberry pi webroot breaks

I have my raspberry pi setup as an internal web server. I have an external hard drive connected to the pi and mounted correctly.
I then symlink two folders from the hard drive to the web root on the pi, one is /Movies, and the other is /Series.
Initially this all works fine, as in if I hit http://192.168.1.17/Movies I get a list of all the files, I then click one and it starts playing no problem. However, after leaving it for a while and coming back, I can still get to the file directory in /Movies or /Series, but when I click a file, the web browser cannot open it.
I have no idea what's going on, it seems weird that I can still access the file directory, but playing a file doesn't work?
Any thoughts or help appreciated.
Are you using an apache server?
If so Symlinking is not a good idea.
An alternative which is more secure and may fix your problem is to install Userdir
sudo a2enmod userdir
Then you need to make a directory in home
mkdir public_html
Restart Apache
sudo service apache2 restart
If you want to change the home directory apache points to you can do so in /etc/apache2/mods-enabled/userdir.conf .Then change the <Directory /home/*/public_html> to the directory you want.
To access you're server simply enter ip_of_Rpi/~pi_username. e.g 192.168.0.100/~pi
more details here: http://ubuntuserverguide.com/2012/10/how-to-enable-and-configure-apache2-userdir-module-in-ubuntu-server-12-04.html
If you are using Apache web server, you can use mod_alias to map some directory in a URL path like this
Alias /mnt/external_disk01/movies /Movies
Alias /mnt/external_disk02/series /Series
Before use alias, make sure it is activated.
To activate:
a2enmod alias
more info in http://httpd.apache.org/docs/2.2/mod/mod_alias.html

How to install VQmod extension for opencart 2.0.x.x without using FTP

I have installed vqmod extension for opencart 2.0.1.0 from following link
http://www.opencart.com/index.php?route=extension/extension/info&extension_id=19501
I have followed installation steps till replaced files.
Now, how I should upload Opencart modifications on localhost.
On admin panel made following setting System->Setting->Store Edit->FTP
FTP Host : localhost
FTP Port : 22
FTP Username : XXXXXX
FTP Password : ******
FTP Root : C:\wamp\www\xxxx
Enable FTP : Yes
But still vqmod is not installed.So, where I am going wrong.
Note: I have made many changes in core files of opencart.
Hope so which doesn't affect vqmod installation.
Thanks in advance for any help.
Looks like you have access directly to your server (localhost - WAMP server), I suggest to follow the official instructions from github.com (https://github.com/vqmod/vqmod/wiki/Installing-vQmod-on-OpenCart) or try to follow my instructions below
First, you need to uninstall the one that you did, just navigate to /admin/controller/extension/ => Delete (backup first) installer.php and modification.php => Rename installer.php.original to installer.php and rename modification.php.original to modification.php
Second, to install vQmod for OpenCart 2:
Download v2.5.1-opencart.zip
Unzip it, inside you will find a folder named "vqmod"
FTP/Copy/Transfer "vqmod" folder to the root of your OpenCart installed folder (where you see: admin, catalog, image, system folders)
Make sure vqmod folder is writable (I guess you don't need to do this with WAMP server)
Then go to http://www.yoursite.com/vqmod/install - if you see a success message, then installation is done. If you see "index.php not writeable", then you need to set your root OpenCart index.php to writable. If you see "Administrator index.php not writeable", then make the "/Admin/index.php" to writable.
I believe for WAMP server (running under Windows), to make something writable = make sure that file don't have Read Only.
If you are not clear about something, just visit github page: https://github.com/vqmod/vqmod/wiki/Installing-vQmod-on-OpenCart
If you still have issue, post comments.

Beginner - setting up local host for Angular app using XAMPP on Windows 7

I have taken a Angular App which works on Local host when I use visual studio IIE server.
I don't want to use Visual Studio and I am trying to test the app locally using XAMPP.
I am a complete beginner, and I cannot get the local host to pick-up the html initialization file. I have checked the following:
Skype is off and the port is set to 80 in XAMMP
the root server in HTTPd.conf is setup correctly (no slash at end)
I am getting a little confused as to 'how' angular will work on the XAMMP local host.
Do I need to get Yeoman or grunt (seen these apps in some posts, but they seem to be for command line environment).
Any help, or even a pointer to a step by step set-up would be great!
Angular is no different from a normal html web page, when it comes to working in a localhost.
Does your XAMPP work with standard HTML files?
Do you have any error generated?
OK. Got this sorted. I was over complicating things entirely, angular runs sweet on regular XAMPP, no Grunt/ Yeoman etc. required.
All you need to do is: 1. install XAMPP 2. Close Skype 3. Place you app, libraries and everything else in the folder C:\xampp\htdocs\
localhost/Angularappstartpage.html
BOOM!
it works.
You may need to adjust the port number on the localhost (default is 80 e.g. localhost:80/...)
You can also change the root folder in your XAMPP config setup to point to your local GIT.
Do this by changing the line in the HTTPD.conf file (click 'config' on the apache module)
DocumentRoot "C:/xampp/htdocs" to DocumentRoot "C:/myLocalGIT"
Hopefully this will help all the new guys out there. Good luck!
Skype blocks the port 80, which is used for browsing. XAMPP uses the same port so exactly.
https://support.skype.com/en/faq/FA148/which-ports-need-to-be-open-to-use-skype-for-windows-desktop
If you use mysql, also open first XAMPP and start your services and then keep working on your SO as always.

Resources