Документация DocC не может быть отображена с помощью Apache на CentOS 7
Я загрузил отсюда образец кода проекта SlothCreator, а затем экспортировал файл SlothCreator.doccarchive.
Я поместил файл SlothCreator.doccarchive в / var / www / html/.
Мой файл .htaccess выглядит следующим образом.
# Enable custom routing.
RewriteEngine On
# Route documentation and tutorial pages.
RewriteRule ^(documentation|tutorials)\/.*$ SlothCreator.doccarchive/index.html [L]
# Route files and data for the documentation archive.
RewriteRule ^(css|js|data|images|downloads|favicon\.ico|favicon\.svg|img|theme-settings\.json|videos)\/.$ SlothCreator.doccarchive/$0 [L]
# If the file path doesn't exist in the website's root ...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# ... route the request to that file path with the documentation archive.
RewriteRule .* SlothCreator.doccarchive/$0 [L]
Я подтвердил, что RewriteEngine работает хорошо.
Я пробую следующие URL-адреса, а затем вижу сообщение об ошибке «Произошла неизвестная ошибка». или «Страница, которую вы ищете, не может быть найдена».
http://localhost/documentation/SlothCreator
=> "An unknown error occurred."
http://localhost/SlothCreator.doccarchive/index.html
=> "The page you’re looking for can’t be found."
Журнал доступа Apache в CentOS:GET /data/documentation/SlothCreator.json HTTP / 1.1"500
"GET /documentation/SlothCreator HTTP/1.1" 200 3789 "-"
"GET /css/index.7bb6526a.css HTTP/1.1" 200 25432 "http:
"GET /js/chunk-vendors.779cfe0d.js HTTP/1.1" 200 93127
"GET /js/index.2b1836ed.js HTTP/1.1" 200 20015 "http://
"GET /css/documentation-topic.9689e104.css HTTP/1.1" 200 468
"GET /css/documentation-topic~topic~tutorials-overview.83d60
"GET /css/topic.71a5a916.css HTTP/1.1" 200 58203 "http://
"GET /css/tutorials-overview.7d1da3df.css HTTP/1.1" 200 1743
"GET /js/chunk-2d0d3105.459bf725.js HTTP/1.1" 200 6923 "http
"GET /js/documentation-topic.d0b0a554.js HTTP/1.1" 200 83535
"GET /js/documentation-topic~topic~tutorials-overview.e72431
"GET /js/highlight-js-bash.85a55401.js HTTP/1.1" 200 2175 "h
"GET /js/highlight-js-c.99b899e6.js HTTP/1.1" 200 3991 "http
"GET /js/highlight-js-cpp.46268241.js HTTP/1.1" 200 5807 "ht
"GET /js/highlight-js-css.c12e29c1.js HTTP/1.1" 200 7055 "ht
"GET /css/documentation-topic~topic~tutorials-overview.83d60
"GET /theme-settings.json HTTP/1.1" 200 1160 "http://
"GET /css/documentation-topic.9689e104.css HTTP/1.1" 200 468
"GET /js/documentation-topic~topic~tutorials-overview.e72431
"GET /js/documentation-topic.d0b0a554.js HTTP/1.1" 200 83535
"GET /js/highlight-js-custom-markdown.fb3d4662.js HTTP/1.1"
"GET /js/highlight-js-custom-swift.b1f7a896.js HTTP/1.1" 200
"GET /js/highlight-js-diff.672514df.js HTTP/1.1" 200 841 "ht
"GET /js/highlight-js-http.ec39e120.js HTTP/1.1" 200 998 "ht
"GET /js/highlight-js-java.a814d7f9.js HTTP/1.1" 200 2526 "h
"GET /js/highlight-js-json.471128d2.js HTTP/1.1" 200 452 "ht
"GET /js/highlight-js-javascript.4d4a362d.js HTTP/1.1" 200 5
"GET /js/highlight-js-llvm.ddaa176e.js HTTP/1.1" 200 2749 "h
"GET /js/highlight-js-markdown.451c845b.js HTTP/1.1" 200 212
"GET /js/highlight-js-objectivec.bcdf5156.js HTTP/1.1" 200 2
"GET /js/highlight-js-python.b6226703.js HTTP/1.1" 200 4373
"GET /js/highlight-js-php.cc8d6c27.js HTTP/1.1" 200 4153 "ht
"GET /js/highlight-js-perl.b3c5d3f2.js HTTP/1.1" 200 4663 "h
"GET /js/highlight-js-ruby.fb547e8d.js HTTP/1.1" 200 3597 "h
"GET /js/highlight-js-scss.33a3a3f7.js HTTP/1.1" 200 7912 "h
"GET /js/highlight-js-swift.0e0d0e76.js HTTP/1.1" 200 7465 "
"GET /js/highlight-js-xml.784eb41b.js HTTP/1.1" 200 2236 "ht
"GET /js/topic.cd2c44f5.js HTTP/1.1" 200 84134 "http://
"GET /js/tutorials-overview.db178ab9.js HTTP/1.1" 200 31964
"GET /data/documentation/SlothCreator.json HTTP/1.1" 500 527
Могу я узнать, в чем проблема?
Я использую веб-сервер Apache в CentOS 7. Разве .doccarchive не работает с CentOS? Я подтвердил, что .doccarchive хорошо работает на Mac.
(Я тоже оставил здесь этот вопрос .)