Linux Centos7 Apache 访问 You don't have permission to
折腾了很久,今天才找到了最正确的答案。感言真不容易。 百度出来的99%都是采集的内容,全都是错误的。 You don 't have permission to access / on this server. 百度出的解决方法: 1)关闭selinux 。坑,服务器根本就没开启selinux 2)修改 httpd.conf 中
折腾了很久,今天才找到了最正确的答案。感言真不容易。
百度出来的99%都是采集的内容,全都是错误的。
You don<span>'t have permission to access / on this server.</span>
百度出的解决方法:
1)关闭selinux 。坑,服务器根本就没开启selinux
2)修改 httpd.conf 中的 allow from all!坑,Apache都2.4+,根本就不存在 allow from all ,现在改为了 Require all granted!
3)修改 chcon -R httpd_user_content_t !坑,误人子弟,CentOS7 中根本就没这样一个上下文,因为selinux根本就没开启
4)修改 chown apache: -R /home/xxx.com/public_html!误人子弟,坑比!这样把目录改了,他本来的用户却没有目录访问权限了!逗比!!!
……
百度了一个多小时,全都是这样的解决方法,出来的网页全都是一大堆广告。
中国的最大搜索引擎搜索出来的都是那种布满广告的采集站!采集站不要紧,关键是全都是广告,连正常的阅读都无法阅读!
最后正确的解决方法:
chmod o+x /home/zbphp.com
上一级目录的其他用户组也必须加上 x 执行权限否则Apache无法读取!
写到最后,感谢segmentfault 社区的热心人,不然真的瞎折腾几天可能又要放弃了。牢骚一下,网上用百度搜索出来的东西根本就不准确!用不了Google,goagent总是断断续续,而且对英文不熟悉。瞎折腾的时候感觉自己就像chaoxian,落后但是自我感觉良好,很多人用百度还觉得自豪爱国。(by default7@zbphp.com)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Running the H5 project requires the following steps: installing necessary tools such as web server, Node.js, development tools, etc. Build a development environment, create project folders, initialize projects, and write code. Start the development server and run the command using the command line. Preview the project in your browser and enter the development server URL. Publish projects, optimize code, deploy projects, and set up web server configuration.

Multithreading in the language can greatly improve program efficiency. There are four main ways to implement multithreading in C language: Create independent processes: Create multiple independently running processes, each process has its own memory space. Pseudo-multithreading: Create multiple execution streams in a process that share the same memory space and execute alternately. Multi-threaded library: Use multi-threaded libraries such as pthreads to create and manage threads, providing rich thread operation functions. Coroutine: A lightweight multi-threaded implementation that divides tasks into small subtasks and executes them in turn.

To open a web.xml file, you can use the following methods: Use a text editor (such as Notepad or TextEdit) to edit commands using an integrated development environment (such as Eclipse or NetBeans) (Windows: notepad web.xml; Mac/Linux: open -a TextEdit web.xml)

Linux is best used as server management, embedded systems and desktop environments. 1) In server management, Linux is used to host websites, databases, and applications, providing stability and reliability. 2) In embedded systems, Linux is widely used in smart home and automotive electronic systems because of its flexibility and stability. 3) In the desktop environment, Linux provides rich applications and efficient performance.

Apache errors can be diagnosed and resolved by viewing log files. 1) View the error.log file, 2) Use the grep command to filter errors in specific domain names, 3) Clean the log files regularly and optimize the configuration, 4) Use monitoring tools to monitor and alert in real time. Through these steps, Apache errors can be effectively diagnosed and resolved.

There are two ways to export XML to PDF: using XSLT and using XML data binding libraries. XSLT: Create an XSLT stylesheet, specify the PDF format to convert XML data using the XSLT processor. XML Data binding library: Import XML Data binding library Create PDF Document object loading XML data export PDF files. Which method is better for PDF files depends on the requirements. XSLT provides flexibility, while the data binding library is simple to implement; for simple conversions, the data binding library is better, and for complex conversions, XSLT is more suitable.

C language conditional compilation is a mechanism for selectively compiling code blocks based on compile-time conditions. The introductory methods include: using #if and #else directives to select code blocks based on conditions. Commonly used conditional expressions include STDC, _WIN32 and linux. Practical case: Print different messages according to the operating system. Use different data types according to the number of digits of the system. Different header files are supported according to the compiler. Conditional compilation enhances the portability and flexibility of the code, making it adaptable to compiler, operating system, and CPU architecture changes.

I developed a project called Lua-Libuv and am happy to share my experience. The original intention of the project is to explore how to use Libuv (an asynchronous I/O library written in C) to build a simple HTTP server without having to learn the C language in depth. With the help of ChatGPT, I completed the basic code of HTTP.C. When dealing with persistent connections, I successfully implemented closing the connection and freeing resources at the right time. At first I tried to create a simple server that ended the main program by closing the connection, but I had some problems. I've tried sending blocks of data using streaming, and while it works, this blocks the main thread. In the end, I decided to give up on this approach because my goal was not to learn C language in depth. Finally, I
