I'm trying to figure out how to tell Netbeans to load the index file that is inside of my public_html folder when the project is ran and I'm not sure how to.
Sources : http://screencast.com/t/kWMCRKOWoo
Run Configuration : http://screencast.com/t/SqZTN7Pu
EDIT :
Can anybody expand on the answer below? Any additional ideas with seeing my two screenshots.
Rightclick on the project in the project explorer.
Click Properties.
Select Run Configurations under categories section.
Update the Project url & Index file fields.
Done ! :)
Update Project folder & Source folder too under sources category if those are incorrect.
You can via localhost only run files inside
http://localhost/WrestlingManager/index.php
and that is mapped to
C:\xampp\htdocs\WrestlingManager\index.php
and that's what you have set in your run configuration.
It's easy if you can run in a browser (for example).
http://localhost/WrestlingManager/public_html/index.php
If you want to run files from another location . You must that folder have in your server conf file
Alias /public_html = "C:/Netbeans/Projects/PhpApp1/public_html"
from my Apache httpd.conf
Alias /samples "D:/mysamples/xysamples"
<Directory "D:/mysamples/xysamples">
Options Indexes FollowSymLinks MultiViews ExecCGI
Order allow,deny
Allow from all
</Directory>
Now I can : http:/localhost/samples
I can not see the real path of the public_html folder inside of your Netbeans project .
In Run configuration you can set
Project URL : http://localhost/WrestlingManager/public_html/
Index File : index.php
Related
Talking about my project I am working, its just a simple website in localhost.I am Xampp server rand inside htdocs my website is in file creative which contains index.php file and another sub directory themes which further contains themes folder which contain all the necessary html php and css files that builds my websites.
When a user enters I want to redirect him from the index.php in localhost/creative to the index.php in localhost/creative/themes/theme-folder. I tried to use require_once('creative/themes/theme-folder/index.php'); but in most of cases it fails. is there any other way to do so.
You can modify the .httpd file.
Then you add:
#The path of your repositories:
DocumentRoot "C:/xampp/htdocs/creative"
#then you make an alias:
Alias /creative "C:/xampp/htdocs/creative/themes/theme-folder"
<Directory "C:/xampp/htdocs/creative/themes/theme-folder">
#Modify this data according to your needs
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
I have moved website from one hosting to another and due to security, PCI and HIPPA reason, I need to move some (files and images) directories outside html folder.
Previous structure : /public_html/uploads
Current structure : /var/www/uploads
For Files : /var/www/html/
I want to know how I can handle uploaded images and images get to display on front page.
Thanks
You could use symbolic links e.g.:
in /var/www/html execute ln -s /var/www/uploads image_uploads then all your images can be referenced with <img src="/image_uploads/some_image_name.jpg">
Be aware than you may need to set alternative permissions in a <Directory> section in your site configuration (I am assuming that you are using Apache).
Something like
<Directory "/var/www/uploads">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
See the Apache documentation for Directory for more information.
I am very new to web servers , php, etc. I built a small web server using Apache 2.2.22 on ubuntu 12.04 LTS. The webpage is for local access only and can be viewed by other devices connected to the access point (No thereat of security). The document root directory is /var/www/, I edited the default index.html file to display what I want to see.
Here I am trying to display few images which is in /home/myname/somedir/, but the images are not displayed. I cannot save the images to the web document root as the images are being updated regularly by another program. How do i access the images and display them.
Things I have tried so far:
Symbolic / soft link
Aliasing: added this to the default configuration file /etc/apache2/sites-available/default
Alias /images/ "/home/myname/somedir/"
<Directory "/home/myna-me/somedir/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
php script: I used the following code in a php script `cam_images.php'
and I called them in the hmtl file as /cam_images.php?file=myfile.jpg referred from here
None of them have worked so far. I'm not sure where I am going wrong. I have also tried readfile() in php, but the function isn't able to open that file. I even tried moving the DocumentRoot to the same directory as of the images but the webpage was not shown
(you don't have permission to access / of the server)
Any help is appreciated.
Thanks
Please check the PHP user has an access to /home/myname/somedir/. Usually only user itself has access to /home/user, so most probably that is the reason.
To fix the permissions:
chmod o+rx /home/myname
chmod -R o+rx /gome/myname/somedir
Is it a way to start a Laravel project in another folder? For example:
instead of C:/xampp/htdocs
to D:/projects/web/project1
So after I download Laravel with composer to my D:/projects/web/project1 folder I want to reach it as: http://project1.local in my browser.
I added 127.0.0.1 project1.local to my hosts but it only opens xampp in the browser.
Suggestions, ideas?
You need to indicate to xampp that your site will be sited outside the documentroot folder (where all the sites in your server are located).
In your httpd.conf file add these lines, which will allow to you to access the site via http://localhost/laravel.project:
Alias /laravel.project "D:/projects/web/project1/public"
<Directory "D:/projects/web/project1/public">
Options FollowSymlinks
AllowOverride none
Require all granted
</Directory>
If you want to get access directly, via a uri like http://laravel.project, you must create a VirtualHost.
I have a created a project named "ProjectName".
I want to change the project name to "NewProject"
I can't change the folder name of the project.
If i change the folder name, URL Manager functions not working.
But i can run proper by disable URLManager functions in /confing/main.php and put index.php? in the url
I have a proper .htaccess file.
No hard codes in my project.
Is any problem in server or code?
I found out the problem.
I add the following lines in apache httpd.conf file.
<Directory /var/www/path/to/NewProject>
AllowOverride All
Options Includes FollowSymLinks
</Directory>
These lines helps to look the .htaccess file. Otherwise ur server skips .htaccess file.
Thank u.