I am working in PHP and want to add the source code as existing project in Netbeans 8.1 on Windows 7 using Ampps.
I have setup virtual hosts and edited the hosts file to create the local site www.mysite.com. Here is the code snippet
httpd-vhosts.conf file
<VirtualHost 127.0.0.1:80>
<Directory "c:/program files/ampps/www/mysite/www">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName www.mysite.com
ServerAlias www.mysite.com
ScriptAlias /cgi-bin/ "c:/program files/ampps/www/mysite/www/cgi-bin/"
DocumentRoot "c:/program files/ampps/www/mysite/www"
ErrorLog "C:/Program Files/Ampps/apache/logs/www.mysite.com.err"
CustomLog "C:/Program Files/Ampps/apache/logs/www.mysite.com.log" combined
</VirtualHost>
Hosts file
127.0.0.1 www.mysite.com
Now as I set up a project in Netbeans with existing sources at the Run Configuration step, the Project URL appears as http:\localhost\www. I want this to be www.mysite.com. How to do this?
Any help appreciated.
Create project from existing source
The image shows the project URL as http:\localhost\www.If it is changed then it displays Project URL is not valid as below
Invalid Project
Creating New Project
Add Project URL and remove index file text if not required.
Already Created Project
Right click on your Project and Select Properties. Select Run Configuration in the left tab. Edit the Project URL as shown in screenshot below.
Related
I have created a virtual host for a drupal website on Windows 10 using Bitnami (WAMPstack),
and when start the website , i can access to the home page only but not to sub pages or sub-directories.
in the windows etc folder i did update the hosts file and added
127.0.0.1 website.local
also edited the httpd.conf enabled the virtual host
(Include conf/extra/httpd-vhosts.conf)
also edited the httpd-vhosts file : added the follwoing
<Directory C:/vhosts>
Require all granted
</Directory>
<VirtualHost *:80>
DocumentRoot "C:/Bitnami/wampstack-7.1.15-0/apache2/htdocs/website/"
ServerName website.local
</VirtualHost>
when i start browsing the site and click on any subpage i got a 404 (Not Found)
please advise.
Seems like you are missing some directives on the directory level. Here is a config that works that basically follows https://www.drupal.org/node/953296#comment-9866119
<VirtualHost *:80>
DocumentRoot /home/myrepo/mydocroot
ServerName mysite.localhost
<Directory /home/myrepo/mydocroot >
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
You might need to activate the mod_rewrite in apache.
Edit the httpd.conf and search for "#LoadModule rewrite_module modules/mod_rewrite.so" remove the "#". Save and restart the apache.
I bought a VPS server, where I installed apache, mysql, php and phpmyadmin. I created database (like in my local project).
So, now I want to migrate a local project to my server and please, tell me I am right:
Files .php has to be in folder var/www on my apache server? (here is index.html too) and from this folder connect with database?
I have to download NPM on ubuntu
I have to download GIT on ubuntu
Download repo from my github where I've got whole code (webpack dist files, node modules, src and whole config) to /var/www catalog
index.html has to be in top-level directory (just in var/www not for example var/www/src
Please help me and tell if I am thinking right.
Files .php has to be in folder var/www on my apache server? (here is index.html too) and from this folder connect with database?
It depends on what you set in /etc/apache2/sites-available/000-default.conf. I assume that you installed with default configuration from apt-get.
index.html has to be in top-level directory (just in var/www not for example var/www/src
If for example your source codes are in /var/www/src instead of /var/www, the just modify the 000-default.conf. Example:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName your_domain_name.com
DocumentRoot /var/www/src/
<Directory />
Options FollowSymLinks
AllowOverride None
Options -Indexes
</Directory>
<Directory /var/www/src>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
Options -Indexes
</Directory>
ErrorLog /var/log/your_log_file.log
LogLevel warn
CustomLog /var/log/your_access_log_file.log combined
</VirtualHost>
Restart Apache and try open in your browser to see if it works.
As for the database, since you have phpmyadmin, just export the sql data from your local machine and import it into the VPS phpmyadmin.
I'm trying to make Laravel coexist with other projects on a local installation under /var/www, the current solution I have is to use an alias for the Laravel directory and several other aliases for the other projects.
For instance:
<VirtualHost *:80>
Alias /laravel /var/www/laravel/public
Alias /other_project /var/www/other_project
<Directory /var/www/other>
Order allow,deny
allow from all
</Directory>
DocumentRoot /var/www/laravel/public
<Directory /var/www/laravel/public>
AllowOverride All
</Directory>
</VirtualHost>
the solution above however makes http://localhost and http://localhost/laravel both redirect to Laravel, if I put say an index.php on the root directory of /var/www this is ignored and the Laravel installation is shown instead.
The directory other_project instead works correctly being completely separated from Laravel and showing its contents.
How can I make http://localhost/ show a standard index.php, http://localhost/laravel show a Laravel installation and http://localhost/other_project show another php project??
Change
DocumentRoot /var/www/laravel/public
To
DocumentRoot /var/www
That is if you want to display anything form /var/www
I am very new to magento and php and i am trying to create a virtual host url for my magento site.
Currently the url is
http://localhost:8080/Magento/
And if i create any website i have to use url's such as below
http://localhost:8080/Magento/website1
http://localhost:8080/Magento/website2
...
After referring to several examples such as this http://sawmac.com/xampp/virtualhosts/ i have managed to configure my files such as below
Step 1:
In the file C:\Windows\System32\drivers\etc\hosts i have append the below mapping
127.0.0.1 clientA.local
Step 2:
And in the file C:\xampp\apache\conf\extra\httpd-vhosts.conf i have append the below code
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:\xampp\htdocs\magento"
ServerName clientA.local
<Directory "C:\xampp\htdocs\magento">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
After step 1 typing typing clientA.local:8080/magento opens localhost:8080/magento
But step 2 doesn't change anything.
I want to do something as below
clientA.local should open http://localhost:8080/Magento/website1
clientB.local should open http://localhost:8080/Magento/website2
...
I have tried changing the Document root , directory in several ways nothing helped.
If any one has any idea on this senario please contribute here.
thanx
I'm trying to set up a new Zend project using Zend Server CE under OS X 10.6
First, I have downloaded and successfully installed Zend Server CE: opening http://localhost:10081 in my browser shows the dashboard, and everything seems to be working fine.
Than I created a new project, following the tutorial:
$ cd /usr/local/zend/apache2/htdocs
$ /usr/local/zend/share/ZendFramework/bin/zf.sh create project quickstart
The project was created without errors.
Then I added
<VirtualHost quickstart.local:10088>
ServerName quickstart.local
DocumentRoot /usr/local/zend/apache2/htdocs/quickstart
SetEnv APPLICATION_ENV "development"
<Directory /usr/local/zend/apache2/htdocs/quickstart>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
to the /usr/local/zend/apache2/conf/extra/httpd-vhosts.conf file and the entry 127.0.0.1 quickstart.local to my /etc/hosts/ file.
Finally, I restarted the Apache bundled with Zend Server CE.
But now, if I open http://quickstart.local:10088/ in my browser, I see this:
instead of the default index view I was expecting.
What a I missing?
Thanks.
I was having a hell of a time trying to figure out the directions from "Zend Framework Quick Start" Even though you didn't solve it, you pointed me in the right direction and I was able to get it. You probably figured it out by now but for everyone else coming to this page here goes:
By default the httpd.conf file has the 'Include httpd-vhosts.conf' line commented out. So edit /usr/local/zend/apache2/conf/httpd.conf to change this line:
#Include conf/extra/httpd-vhosts.conf
to this line:
Include conf/extra/httpd-vhosts.conf
We are almost done now. The code you added to /usr/local/zend/apache2/conf/extra/httpd-vhosts.conf wasn't quite correct. It should be:
<VirtualHost quickstart.local:10088>
ServerName quickstart.local
DocumentRoot /usr/local/zend/apache2/htdocs/quickstart/public
SetEnv APPLICATION_ENV "development"
<Directory /usr/local/zend/apache2/htdocs/quickstart/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Notice how I added the /public onto the paths. Otherwise you won't point to the index.php file. Now restart Apache using this command sudo /usr/local/zend/bin/zendctl.sh restart
and it should now be working.
Happy coding :)