首页 > 阿里云下配置apache用于flask应用无法外网访问

阿里云下配置apache用于flask应用无法外网访问

在配置/etc/apache2/sites-available/FlaskApp.conf时

<VirtualHost *:80>
                ServerName 我的阿里云公网ip
                ServerAdmin youemail@email.com
                WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
                <Directory /var/www/FlaskApp/FlaskApp/>
                        Order allow,deny
                        Allow from all
                </Directory>
                Alias /static /var/www/FlaskApp/FlaskApp/static
                <Directory /var/www/FlaskApp/FlaskApp/static/>
                        Order allow,deny
                        Allow from all
                </Directory>
                ErrorLog ${APACHE_LOG_DIR}/error.log
                LogLevel warn
                CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

这样配置完后启动一个flask应用,访问我的网站出现下列错误:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at youemail@email.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.7 (Ubuntu) Server at 121.42.179.21 Port 80

怎么解决?

【热门文章】
【热门文章】