Accessing particular file in website - expressionengine

I've developed a push notification using php and put that one inside server, lets say in the folder /system/expressionengine/controllers/cp/gcm_server_php/.
But when I type its path:
www.website.com//system/expressionengine/controllers/cp/gcm_server_php/file.html
it shows that the website is not found. Can anyone please help on how to access that particular file. I'm newbie to this. Thanks

If I understand your problem, you are trying to link to a file, which is not in your web root folder.
If so, you can create a symbolic link to the file in a folder accessible from the web.
For example (if /var/www is your web root)
ln -s /system/expressionengine/controllers/cp/gcm_server_php/ /var/www
creates a symbolic link to *gcm_server_php* in your web root, so *www.website.com/gcm_server_php/file.html* links to your file.

Related

apache2 on ubuntu webserver rejects permission to access any other file than the delivered index.html

I am trying to set up a webserver running on Ubuntu. I have installed Apache and changed the root directory to an other directory within /var/www/. When I copy the index.html provided by Apache to that directory, I can access that file via remote webbrowser. But if I want to use a different index.html file, even really basic ones, I get an error: "Forbidden You don't have permission to access this resource". I have also tried to download that html, alter just a few lines and put it back on to the server with the result that it also shows that error. If I rename the initially provided index.html to index2.html I can still access it. I do not understand how it is possible that only this exact file is working.
I have tried to grant more permissions with Directory and restarted Apache but it won't work. I am rather new to Linux and Apache, can only use the terminal on my webserver and I do not know what else to do. Please help.
Change the permissions on the file, too, not just the folder. Pretty sure this fix it.
For diagnostic correction, allow permission for all by typing:
sudo chmod -R 777 /path/to/index.html

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)

/temp/ directory disappears cpanel

I have a dedicated server running Linux/Apache with cPanel. On one of my website's users are able to register and upload images.
However, over the last few days, i have received complaints that users cannot upload any media. When I check the /images/ directory I see that the /temp/ folder is missing.
So I re-created it and set the permissions to 0777.
Once that is completed all works fine. But I cannot understand why the directory is being removed. No one else has access to the site and I do not see anything in my error logs that show anything unusual.
Any ideas why this may happen?
Thank you
You need to check your PHP Script has code to unlink(dir) or Something
and Check cron list whether you have added any CRON to remove the TMP folder.
for Write permission 755 is enough If you are using Fcgi php handler, cgi, dso. Have a try 755 permission with one of the listed Handlers.

Copy site but preserve permissions

I wanted to copy my Drupal site to another location (VDS), I got full backup from my provider, (in tar.gz), untarred and ungzipped it, deleted some folders, zipped it again in 7zip format, then copied it with sftp to /var/www on VDS and unzipped, but all permissions now are read-only and so Drupal doesn't work at all cause it cannot acess files.
Can anyone tell when I lost my permissions, the right way to migrate to my VDS or (and) how can I manage with my corrupted-permission Drupal now (maybe I just can change them?)
Read only permission is generally fine for a Drupal site, except for the upload folder (it's nomally called files and in can be in sites/default or in sites/YOUR_SITE_CONFIGURATION_FOLDER or wherever you set it to be in admin/config/media/file-system). The files folder, and every subfolder it contains must be writable from the web server, so if your web server is running as the www-data user (the standard user for Apache in Ubuntu, other systems may differ) you can for example do
chmod -R o+w sites/default/files
chown -R www-data sites/default/files

Where to administer apache fallback directory

I have been put in charge of an Ubuntu 13 server installation. Apache is configured to use /var/www as the default directory which is correct. The issue is that it seems there is a fallback directory configured that points to /usr/share. So if I type into a browser (www.address.com) it will serve the documents out of /var/www, but if I know the name of a directory in /usr/share and type in (www.address.com/sharedir) then it will serve out of the /usr/share directory. I have looked in the apache config file and default site config file and do not see this association. I do not want this behavior and am concerned that this is the default behavior out of the box.
Can anyone guide me to another areas where this behavior may be controlled/managed.
Thanks for any assistance.
Open your
/etc/apache2/sites-available/default
file and replace
/var/www
to
/path/to/folder/you/wish
save and it will be better to restart apache by
service apache2 restart
Now put website contents to the new location /path/to/folder/you/wish.
Once you changed the Document root of the of the site as mentioned above, Then no files will be fetched from any other location. Hopes this will help you. :)
[SOLVED] After a bunch more digging around I discovered that the user that originally set up this server erroneously put .conf files in the 'conf.d' directory and 'mods-enabled' directory that were routing traffic to the other directories. Sorry to anyone that noodled on this one.

Resources