I am creating a provision shell script file and in Laravel I have a public folder and not html like in a default Apache install.
So, I end up deleting html and index.php example file all the time.
Is there any option while installing apache2 on my system to not create html folder and the example file?
Related
I want to open a local file in it's default program.
Here's the funny part:
a php page running on my fresh wamp install with thius html:
<A HREF="C:/www/rensa/files/John, Osaka food.avi">
will not open a file.
If I copy/paste all of the source code into a html file on my desktop then the link works.
ie, it has to be apache that blocks it from opening.
What do i need to change in the apache config to allow it to open local files in the default program?
I got a copy of my project from work, and put it into the www folder of Wamp, in a different PC. However, when loading localhost, I am not able to see the folder in the list.
I attempted to create a few new folders, and they display correctly in localhost. Even if I rename this folder to something else, it still refuses to show up.
This is what my www directory looks like :
And this is what localhost shows me:
Update :
If I copy the files inside mainProject and paste them into either test1 or test2, that folder disappears from localhost as well.
Update 2:
Deleting/Removing the .htaccess file from mainProject makes the folder visible in localhost, but when I try to access it, it gives me file not found error for obvious reasons! Can add snippets from the .htaccess file if needed!
You should not put anything into the \wamp\www folder, this is where the WAMPServer homepage lives in a file called index.php
So it looks from you first sentence that you have overwritten this file with one of your own projects files.
The simple solution is to install WAMPServer onto another PC and restore the \wamp\www folder from there. Alternatively uninstall WAMPServer, delete the \wamp folder and all subfolders, re-install WampServer and then copy your project into a sub folder of the \wamp\www folder. The wamp homepage is not actually required, but it can make life easier.
Also check the wampserver.com/forum/en there is a document there called 'WAMPServer 2.5 The Homepage, Your Projects Menu and the need for Virtual Hosts ' describing how to setup Virtual Hosts which also provides a more buttet proof environment to run a project in.
ADDITIONAL INFO:
Ok now you have undone the damage you did, you now need to learn how to create a Virtual Hosts for each of the projects you want to run/develop.
You can undo the changes you made to Document Root, Directory and Virtual Host in the httpd.conf file, these can all be individually set from within a Virtual host definition.
See this post on the WampServer forum site
When you generate Yii 1.x auto-generated application, app's private yiic is placed in protected folder. However, when I use it to execute yiic help shell, I see following message:
It is recommended that you execute this command under
the directory that contains the entry script file of
the Web application.
And then:
* entry-script | config-file: optional, the path to
the entry script file or the configuration file for
the Web application. If not given, it is assumed to be
the 'index.php' file under the current directory.
What am I missing? The protected folder is not the same folder as entry script's one (index.php). Should I move my yiic there for the purpose of executing console commands?
If yes, then why yiic is placed protected folder by default, not there, where entry script is?
If not, then why yiic assumes, that index.php exists in the same folder as yiic itself and why do I have to change this every time with using entry-script flag? This just doesn't make any sense!
I think, the answer is to keep yiic in protected folder, which is secured from web access by .htaccess file. Entry script's folder is not secured that way and is web accessible. I would personally be very worried about moving yiic to root folder, where index.php file exists. If this is the correct answer, then what is the purpose of this confusing message, cited above?
This answer seems to be supporting my idea, as it shows that CRON call should point to yiic placed in protected folder, not to the one in root folder.
Why Yii developers put yiic, where it is not supposed to be (it is looking for index.php in the same folder, so in default auto-generated application, it will fail, not finding it)? How should I understand this situation? Why I'm forced to use extra flag every time? Why default folder structure and file placement does not replicate, what yiic assumes as default?
What the help message means is that you should execute the yiic command from the WebRoot folder (where your index.php is) like so:
% cd WebRoot
% YiiRoot/framework/yiic shell
So yii will take automatically your index.php file to do its things...
But if you want to call another file like index-test.php to get yii executed instead of the default index.php you can:
% cd WebRoot
% YiiRoot/framework/yiic shell index-test.php
http://www.yiiframework.com/doc/guide/1.1/en/topics.console
In my /var/www/ i have:
my_project
|-app
|-controllers
|-models
|-views
|-core
|-css
|-js
|-public
|-index.php
I have set up "DirectoryRoot" to:
/var/www/my_project/public/
Now when i open web page in browser my views are loaded but links to files in css and js folders don't work. It looks like I can't go one directory up. What am i doing wrong ?
I have a couple of compressed zip file with static HTML content (e.g. a directory tree of documentation with several static html pages that link to each other, images, css, etc.) For instance, the javadoc zip file serves as an equivalent example for my purpose.
My question is, if there's an apache module that would allow apache to "mount" a zip file as a virtual directory, whose contents are those of the zip file. The operating system in which I'm hosting apache is Mac OS X Snow Leopard.
There is a zip filesystem for FUSE, which is supported on OS X via the MacFUSE project. This will let you mount a zip file via the mount command, thus allowing Apache -- or any other application -- to access its contents as a normal directory.
I don't have my Mac handy at the moment so I can't actually test it out.
I'm not aware of any existing Apache modules to do this, but you could implement it without touching Apache internals by adding a CGI script which handles access to ZIP archives:
Action zip-archive /cgi-bin/ziphandler.cgi
AddHandler zip-archive .zip
This will make ziphandler.cgi get called for all accesses to .zip files, or (more importantly!) to files in "directories" under .zip files. From there, it should be pretty straightforward.
Using proxy_http you can forward requests to Jetty which will serve any ZIP file.
Download Jetty Runner from here: http://mvnrepository.com/artifact/org.eclipse.jetty/jetty-runner
You can run it using e.g. java -jar jetty-runner-9.3.0.M2.jar --port 8082 myZIPFile.zip. Now set up Apache to forward requests to localhost:8082. You can do that for even only one subdirectory.