/var/www/vhosts/m-auto.co/httpdocs
Edit: /var/www/vhosts/m-auto.co/httpdocs/deployment_checklist.php (6860B)
M-AUTO Deployment Checklist";
echo "";
// File checks
echo "
📁 File Structure Check
";
$required_files = [
'index.php' => 'Main homepage',
'includes/config.php' => 'Configuration file',
'includes/db_production.php' => 'Production database connection',
'.htaccess' => 'Apache configuration',
'robots.txt' => 'Search engine instructions',
'sitemap.xml' => 'Site map for SEO',
'404.php' => 'Custom 404 error page',
'500.php' => 'Custom 500 error page'
];
foreach ($required_files as $file => $description) {
if (file_exists($file)) {
echo "
✓ $description ($file)
";
} else {
echo "
✗ $description ($file) - MISSING
";
}
}
// Directory checks
echo "
📂 Directory Structure Check
";
$required_dirs = [
'admin' => 'Admin panel',
'includes' => 'Include files',
'assets' => 'Static assets',
'uploads' => 'Upload directory'
];
foreach ($required_dirs as $dir => $description) {
if (is_dir($dir)) {
$writable = is_writable($dir) ? 'Writable' : 'Not Writable';
$class = is_writable($dir) ? 'completed' : 'pending';
echo "
✓ $description ($dir) - $writable
";
} else {
echo "
✗ $description ($dir) - MISSING
";
}
}
// Database check
echo "
🗄️ Database Check
";
try {
include 'includes/db.php';
if ($conn && !$conn->connect_error) {
echo "
✓ Database connection successful
";
// Check critical tables
$critical_tables = ['users', 'permissions', 'user_permissions', 'cars', 'settings'];
foreach ($critical_tables as $table) {
$result = $conn->query("SHOW TABLES LIKE '$table'");
if ($result && $result->num_rows > 0) {
echo "
✓ Table '$table' exists
";
} else {
echo "
✗ Table '$table' missing
";
}
}
// Check admin user
$admin_check = $conn->query("SELECT COUNT(*) as count FROM users WHERE id = 1");
if ($admin_check) {
$admin_exists = $admin_check->fetch_assoc()['count'] > 0;
if ($admin_exists) {
echo "
✓ Admin user (ID=1) exists
";
} else {
echo "
✗ Admin user (ID=1) missing
";
}
}
} else {
echo "
✗ Database connection failed
";
}
} catch (Exception $e) {
echo "
✗ Database error: " . $e->getMessage() . "
";
}
// Security check
echo "
🔒 Security Check
";
$security_checks = [
'includes/config.php' => 'Configuration file should not be web accessible',
'includes/db.php' => 'Database file should not be web accessible',
'.htaccess' => 'Security rules should be in place'
];
// Check if sensitive files are protected
$htaccess_content = file_exists('.htaccess') ? file_get_contents('.htaccess') : '';
if (strpos($htaccess_content, 'includes/*') !== false) {
echo "
✓ Includes directory protected
";
} else {
echo "
⚠ Includes directory protection not found in .htaccess
";
}
if (strpos($htaccess_content, 'config.php') !== false) {
echo "
✓ Config file protected
";
} else {
echo "
⚠ Config file protection not found in .htaccess
";
}
// SEO check
echo "
🔍 SEO Check
";
if (file_exists('robots.txt')) {
echo "
✓ robots.txt exists
";
} else {
echo "
⚠ robots.txt missing
";
}
if (file_exists('sitemap.xml')) {
echo "
✓ sitemap.xml exists
";
} else {
echo "
⚠ sitemap.xml missing
";
}
// Performance check
echo "
⚡ Performance Check
";
if (strpos($htaccess_content, 'mod_deflate') !== false) {
echo "
✓ Gzip compression enabled
";
} else {
echo "
⚠ Gzip compression not configured
";
}
if (strpos($htaccess_content, 'mod_expires') !== false) {
echo "
✓ Browser caching configured
";
} else {
echo "
⚠ Browser caching not configured
";
}
// Final recommendations
echo "
📋 Pre-Deployment Checklist
";
echo "
";
echo "
□ Update database credentials in includes/config.php
";
echo "
□ Export database using export_database.php
";
echo "
□ Test server_check.php on production server
";
echo "
□ Run update_urls.php after deployment
";
echo "
□ Install SSL certificate
";
echo "
□ Enable HTTPS redirect in .htaccess
";
echo "
□ Set up regular backups
";
echo "
□ Configure error logging
";
echo "
□ Delete deployment scripts after successful deployment
";
echo "
";
echo "
🚀 Ready for Deployment?
";
echo "
";
echo "Next Steps:
";
echo "1. Follow the instructions in DEPLOYMENT_GUIDE.md
";
echo "2. Upload files to your VPS
";
echo "3. Import database
";
echo "4. Update configuration
";
echo "5. Test everything
";
echo "6. Go live!";
echo "
";
echo "
Generated on: " . date('Y-m-d H:i:s') . "
";
?>