Change httpd.conf of specific user - centos

I want to change the httpd.conf file of a specific user on our server. I've found the main httpd.conf file, but I can't find the httpd.conf file for a specific user.
I'm running CentOs 6.4

Found it: /usr/local/directadmin/data/users/USER/httpd.conf

Related

Installing Moodle: It is requesting 5000 under Max_input_vars

I cannot find the php.ini file or .htaccess file where I'm meant to change the max_input_vars to 5000 in my moodle website folder. I'm using mamp and myphpadmin
Moodle explains "To change max_input_vars you can either set it in php.ini or modify it in runtime, for example for Apache you can create .htaccess file: php_value max_input_vars 5000"
I searched in finder.
Create a test php file in the root of the Moodle folder with
<?php
phpinfo();
Then open it from the browser, not the command line (the command line and web server might use different versions of php)
eg: yourmoodlesite/test.php
This will display the location of the php.ini file that is being used, eg:
Loaded Configuration File /etc/php/7.4/apache2/php.ini
I haven't used MAMP, but the documentation says the php file can also be edited via the menu in MAMP PRO
File > Open Template > PHP > [PHP version] -> php.ini
It also says the location is
/Library/Application Support/appsolute/MAMP PRO/conf
https://documentation.mamp.info/en/MAMP-PRO-Mac/Menu/

Deploying a Static website on Server

I am trying to built a static website using godaddy server. I created a folder say Manage inside public_html in which there is an index.php. Now when I am trying to open this page on browser with URL "www.mysite.com/Manage/index.php" It is showing error, File not found, 404 error. So what possible error I might be making?
There could be a few reasons. If you are using an RHEL-based distribution for your server, you need to edit the master Apache configuration file /etc/httpd/conf.d/userdir.conf and change two things:
Change UserDir disabled to UserDir disabled root
If #UserDir public_html is commented change it to UserDir public_html
This tells Apache that the directory containing each user's html files is a subdirectory of their home directory called public_html.
You may also need to change the permissions of your user directory and your public_html directory to allow Apache to read and execute inside them. To do this, run the following commands:
sudo chmod o+x /home/myusername
sudo chmod o+rx /home/myusername/public_html
Restart Apache and see if it works.
The source for this knowledge is not my brain. It comes from the wonderful course at Washington University in St. Louis CSE 330 Rapid prototype development.
At first look to error.log. If you use nginx find in /var/log/nginx, if httpd in /var/log/httpd.
And what do you mean about "static"? PHP preprocessor generate html from *.php files, so you index.php is not static.
For this case you need to setup LAMP stack.

In htdocs htaccess file not found

where the htaccess file stored in htdocs folder.
I try find it in my development server but i did not find it.
Whenever i try to type url which is not valid it is redirect to home page of site.
I am not able to find out where setting will be stored.
Thanks
Depending on what OS you use, Linux will recognize the .htaccess file as hidden Windows doesn't.
The .htaccess file could be in the root folder of your webserver (htdocs for example).
But it doesn't need to be there by default. If it is not in there by default you can just create one your self
Are your trying to find with server machine by connect with FTP via Filezilla.
If filezilla means you can't see the htdocs file, instead of that you can connect with Winscp means you can find the .htaccess file

Changed upload_max_filesize in php.ini but phpinfo doesn't show the change

Basically phpinfo says upload_max_filesize is 2M, but I changed it in the php.ini file to 8M. I am using MAMP, so I restarted MAMP and phpinfo still says 2M. I checked the path to the php.ini file that phpinfo shows and it matched up exactly. See the YouTube video of me documenting all of this.
You should change the file in /Applications/MAMP/bin/php/php5.4.10/conf/php.ini
After you should reset MAMP. I also changed all php.ini before, and phpinfo() doesn't had been change, but I don't sure if it is need to works, so if only changing the file in the path above, try change the others also.
I hope that help you.
On MAC os make sure you are at the right path:
/Applications/MAMP/bin/php/phpx.x.x/conf/php.ini
I see a lot of people had trouble with this since there is also another conf directory
To be sure, write a file with this PHP content:
<?php
phpInfo();
?>
and save it in your main MAMP document root (as any other web page) with name info.php
Open that file as a web URL in your browser as any other MAMP web page, as an example: http://127.0.0.1:8888/info.php
Search for the string: php.ini in that page.
You will find a line like this:
Configuration File (php.ini) Path /Applications/MAMP/bin/php/php7.2.8/conf
That line will show you the correct path for the ini file PHP is using in that moment. It depends on the PHP version you are using.
Delete (or rename with an unguessable name) the info.php file, after (avoid giving all this info to the world).
In httpd.conf file the PhpIniDir had the wrong path. It was off by one directory. That was the fix!
You can update PHP configurations using below:
File(menu) -> Open template -> PHP -> {select PHP version that you want update}
Source: http://blog-en.mamp.info/2009/09/increase-php-memory-limit-with-mamp-pro.html
MAMP PRO php config file is loaded from other path.
I found it after replace all php infos from mamp/bin/php/ directory without results.
/Applications/MAMP PRO/MAMP PRO.app/Contents/Resources/php(VERSION).ini
I have the same problem with MAMP (non pro), MAM is stopped
the current php version I am using is php7.2.20, I have changed everywhere in
/Applications/MAMP/bin/php/php7.2.20 and /Applications/MAMP/conf/php7.2.20
post_max_size = 128M
upload_max_filesize = 128M
I restart MAMP and I get php7.2.20
post_max_size = 8M
upload_max_filesize = 32M

Where is the web server root directory in WAMP?

Also is the web server root directory the place where you put your site files and later acces them with localhost/file_name in the browser?
If you installed WAMP to c:\wamp then I believe your webserver root directory would be c:\wamp\www, however this might vary depending on version.
Yes, this is where you would put your site files to access them through a browser.
In WAMP the files are served by the Apache component (the A in WAMP).
In Apache, by default the files served are located in the subdirectory htdocs of the installation directory. But this can be changed, and is actually changed when WAMP installs Apache.
The location from where the files are served is named the DocumentRoot, and is defined using a variable in Apache configuration file. The default value is the subdirectory htdocs relative to what is named the ServerRoot directory.
By default the ServerRoot is the installation directory of Apache. However this can also be redefined into the configuration file, or using the -d option of the command httpd which is used to launch Apache. The value in the configuration file overrides the -d option.
The configuration file is by default conf/httpd.conf relative to ServerRoot. But this can be changed using the -f option of command httpd.
When WAMP installs itself, it modify the default configuration file with DocumentRoot c:/wamp/www/. The files to be served need to be located here and not in the htdocs default directory.
You may change this location set by WAMP, either by modifying DocumentRoot in the default configuration file, or by using one of the two command line options -f or -d which point explicitly or implicity to a new configuration file which may hold a different value for DocumentRoot (in that case the new file needs to contain this definition, but also the rest of the configuration found in the default configuration file).
Everything suggested by user "mins" is correct, and excellent information.
WAMP 2.5 provides a default Server Configuration display when you enter localhost into your browser. This maps to c:\wamp\www, as described in previous posts. Creating subdirectories under www will cause Projects to appear on this display. A click and you're in your project.
I have various projects under different directory structures, sometimes on shared drives which makes this centralized location of files inconvenient. Luckily, there is a second feature of WAMP 2.5, an Alias, which makes specifying the location of one (or more) disparate web directories quite easy. No editing of configuration files. Using the WAMP menu, choose Apache > Alias directories > Add an Alias.
WAMP has evolved nicely to provide support for a variety of developer preferences.
If you use Bitnami installer for wampstack, go to:
c:/Bitnami/wampstack-5.6.24-0/apache/conf (of course your version number may be different)
Open the file:
httpd.conf in a text editor like Visual Studio code or Notepad ++
Do a search for "DocumentRoot". See image.
You will be able to change the directory in this file.
To check what is your root directory go to httpd.conf file of apache and search for "DocumentRoot".The location following it is your root directory
this is the path to the web root directory c:\wamp\www
you can create different projects by adding different folders to this directory and call them like:
localhost/project1 from browser
this will run the index.html or index.php, lying inside project1
Here's how I get there using Version 3.0.6 on Windows