Setting up Apache - linux

I'm setting up Apache server for elgg (an open source social networking framework) . I've installed apache2 on ubuntu and created a new file 'elgg' on 'sites-available' folder in /etc/apache2/ , copying the contents of default file already in that folder .I also changed the document root and directory setting inside the file and made no other changes .I enabled the site using a2ensite . But when i try to access the site through the browser it says - 403 forbidden , You cannot access this diectory . Is there something i did wrong ? I gave all users read ,write and exec permission in document root folder , still it's shown as forbidden

Check if one of the files specified as 'DirectoryIndex' is available and accessible, or if 'Indexes' is as Option.
Check for .htaccess files with possible 'Deny' conditions, or a Deny condition in your 'elgg' file in sites-available.
(Edit: removed 1, was already done)

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

httpd not reading the document root in conf/httpd.conf as expected

I have a Laravel project on my CentOS7 server which sits on the folder "/var/www/html/myProject".
I have changed my document root in /etc/httpd/conf/httpd.conf to "/var/www/html/myProject/public" both in "DocumentRoot" and in the directory configure so when i enter the IP in the browser it will automatically show the project.
When i try to do so and access my IP through the browser i am greeted with the messages:
Forbidden
You don't have permission to access /form on this server.
Server unable to read htaccess file, denying access to be safe
After further examination i have found out that in my /var/log/httpd/error_log i get the following error after every access attempt:
[Thu May 10 19:39:33.683522 2018] [core:crit] [pid 1994] (13)Permission denied: [client 79.182.62.1:51091] AH00529: /var/www/html/myProject/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/myProject/' is executable
That was very odd to me since the path is supposed to be /var/www/html/myProject/public, but the "public" is missing.
I have restarted my apache several times, and changed the DocumentRoot path to a fictional path just to check if it updates and it is.
Could it maybe be something in the .htaccess file? although i didn't change the file, i left it as Laravel created it.
Check the permissions on /var/www/html/myProject files & directories. Based on the error you pasted it seems apache is attempting to read in data from your myProject directory as directed by the .htaccess file. This is normal operation.
Figure out what user/group your apache is running is. Then remember that your files have to be readable that user and all parent directories have to be accessible (hint: execute bit) for that user.
Finally check the bootstrap/cache and storage laravel directories (& subdirectories) are writeable by the apache user.

Add install from web tab Joomla error

When I'm clicking to install from web tab it gives me the errors below:
JFolder::create: Path not in open_basedir paths
JFolder: :files: Path is not a folder. Path: httpdocs/tmp/install_560ac9e0129e1
JFolder: :folder: Path is not a folder. Path: httpdocs/tmp/install_560ac9e0129e1
JFolder: :files: Path is not a folder. Path: httpdocs/tmp/install_560ac9e0129e1
JInstaller: :Install: Cannot find Joomla XML setup file
any help?
The problem may be because upload_tmp_dir isn't set in php.
Look in SITE > SYSTEM INFORMATION > PHP INFORMATION and check if upload_tmp_dir has been set. If not, you need to edit php.ini
On our servers (which use open base dir), the setting is:
upload_tmp_dir=/tmp
This value could be different for you, depending on your server configuration.
Check the permission for the folder /tmp. If it is a windows server, check if the webuser is allowed permission to create files and folder.

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.

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